[Insight-developers] My experience with gerrit

Daniel Blezek Blezek.Daniel at mayo.edu
Wed Aug 25 13:06:27 EDT 2010


Hi Brad,

  Another way to do this is to continue your micro commit workflow (which I
really like), but cherry pick your commits into another branch that you send
off to Gerrit.  Again, I don¹t know exactly how to cherry pick, but I see
the term used a lot with Gerrit/git.

  I firmly believe that Gerrit will be an excellent way to work on ITK v4.
It will help us have a record of progress.  A little bit of rebasing pain is
a small price to pay.

Best,
-dan


On 8/25/10 11:59 AM, "Bradley Lowekamp" <blowekamp at mail.nih.gov> wrote:

> Dan,
> 
> After I saw this behavior of Gerrit, I do recall some one saying that it is a
> commit level review tool.
> 
> To squash multiple commits in a branch to a single one, the following could be
> done:
> 
> git log master..jpeg2000io_review
> 
> Which shows I have 5 commits in my branch, then perform interactive rebasing:
> 
> git rebase -i jpeg2000io_review~5 jpeg2000io_review
> 
> Then in the editor I would set all but the oldest commit to squash.
> 
> But I don't think I want to do this, as I have been liking the branchy micro
> commit workflow (which I thought was the git way). So I may default to still
> sharing my code on github, for now.
> 
> Brad
> 
> 
> On Aug 25, 2010, at 12:50 PM, Daniel Blezek wrote:
> 
>> Hi Brad,
>> 
>>   My understanding from (briefly) reading the Gerrit docs is that this is the
>> expected behavior.  Each change to Gerrit is expected to be separately
>> reviewed.  If you want to avoid this, you can squash your changes with rebase
>> (see this posting
>> http://www.mailinglistarchive.com/html/repo-discuss@googlegroups.com/2009-04/
>> msg00135.html).  Then you must only push the single commit containing the
>> squashed series of commits.
>> 
>> I¹m not sure exactly how to rebase properly, nor how to push only one commit
>> to Gerrit.  Perhaps Brad King or Marcus Hanwell can comment?
>> 
>> Thanks,
>> -dan
>> 
>> 
>> On 8/25/10 11:29 AM, "Bradley Lowekamp" <blowekamp at mail.nih.gov
>> <x-msg://449/blowekamp@mail.nih.gov> > wrote:
>> 
>>> Hello all,
>>> 
>>> I just tried to push to gerrit and it didn't go how I was hopping. I just
>>> finished rebasing my topic branch after the effects for uncrustification of
>>> ITK. I have the changes here on github:
>>> 
>>> http://github.com/blowekamp/ITK/commits/jpeg2000io_review
>>> 
>>> With GIT I have been using the philosophy of making more frequent and
>>> smaller commits. Make a change, build it test it, commit it. So for this
>>> topic, I have done 5 small commits, as show above.
>>> 
>>> So with Gerrit, I did the following ( which seemed reasonable ):
>>> 
>>> blowek1$ git push gerrit jpeg2000io_review:refs/for/master/jpeg2000io_review
>>> 
>>> Counting objects: 31, done.
>>> Delta compression using up to 8 threads.
>>> Compressing objects: 100% (26/26), done.
>>> Writing objects: 100% (26/26), 4.14 KiB, done.
>>> Total 26 (delta 21), reused 0 (delta 0)
>>> remote: (W) 26c0e7: commit subject >65 characters; use shorter first
>>> paragraph
>>> remote: (W) 26c0e7: commit message lines >70 characters; manually wrap lines
>>> remote: (W) b788dc: commit subject >65 characters; use shorter first
>>> paragraph
>>> remote: (W) b788dc: commit message lines >70 characters; manually wrap lines
>>> remote: (W) 55057e: commit message lines >70 characters; manually wrap lines
>>> remote: 
>>> remote: New Changes:
>>> remote:   http://review.source.kitware.com/3
>>> remote:   http://review.source.kitware.com/4
>>> remote:   http://review.source.kitware.com/5
>>> remote:   http://review.source.kitware.com/6
>>> remote:   http://review.source.kitware.com/7
>>> remote: 
>>> To blowekamp at review.source.kitware.com:ITK
>>> <x-msg://449/blowekamp@review.source.kitware.com:ITK>
>>>  * [new branch]      jpeg2000io_review -> refs/for/master/jpeg2000io_review
>>> 
>>> First I am not sure what the issue is with the commit message. I write a
>>> short first line and then a long description ( no wrapping ), like I have
>>> been told is good practice with git.
>>> 
>>> So the issues are:
>>> Each commit came up as a separate issue. I did not expect this. Perhaps my
>>> commit are too small, but this was not the result I expected.
>>> I am not sure the branch thing really works with gerrit. This topic is to be
>>> merged into master ( I will normally use the staging area to perform this ).
>>> I suppose gerrit is for the commit level review  and not the branch?
>>> 
>>> It case someone doesn't have this handy:
>>> 
>>> http://review.source.kitware.com/
>>> 
>>> Brad
>>> 
>>> 
>>> ========================================================
>>> 
>>> Bradley Lowekamp
>>> 
>>> Lockheed Martin Contractor for
>>> 
>>> Office of High Performance Computing and Communications
>>> 
>>> National Library of Medicine
>>> 
>>> blowekamp at mail.nih.gov <x-msg://449/blowekamp@mail.nih.gov>
>>> 
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Powered by www.kitware.com <http://www.kitware.com>
>>> 
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>> 
>>> Kitware offers ITK Training Courses, for more information visit:
>>> http://kitware.com/products/protraining.html
>>> 
>>> Please keep messages on-topic and check the ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>> 
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-developers

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.daniel at mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org
"It is more complicated than you think." -- RFC 1925

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20100825/6d01940f/attachment.htm>


More information about the Insight-developers mailing list