[Insight-developers] Gerrit, Git, aliases and squashing commits

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Sat Oct 16 06:52:43 EDT 2010


Le 15 oct. 10 à 23:51, Gaëtan Lehmann a écrit :

>
> Hi,
>
> I'm working on the integration in ITK of the rest of my contribution  
> "Label object representation and manipulation with ITK". I already  
> have 25 commits - one per new class with its tests - and a few more  
> to come.
>
> I don't want to merge all those commits in a single one - I think  
> they are quite logical that way, and a huge commit would be quite  
> hard to review in gerrit - but I'm afraid such a set of commits in  
> gerrit wouldn't be much usable.

I've pushed my commits to github, if someone wants to see how it looks

   http://github.com/glehmann/ITK/commits/labelmap

>
> What would be the best way to go?
>
> Regards,
>
> Gaëtan
>
>
>
>
> Le 15 oct. 10 à 19:53, Marcus D. Hanwell a écrit :
>
>> Hi,
>>
>> I was going through some of the instructions on the ITK community  
>> concerning Gerrit and staging changes. I will talk more about this  
>> at the ITK meeting in November, but I don't think you should be  
>> squashing commits before sending them to Gerrit unless you also  
>> intend to merge them into ITK in that form. Gerrit is offering us  
>> review of commits before they go into our repository, and the  
>> opportunity to fix these commits before they are merged.
>>
>> If you think there are too many micro-commits to push to Gerrit  
>> then I would argue there are too many to push into our repository.  
>> The whole point of retaining history is so that people can also go  
>> in after the fact and review previous commits for various reasons.  
>> Gerrit tracks the dependencies of commits in a topic branch, you  
>> can look at a patch's dependencies and follow needed-by until you  
>> reach the end of a topic branch. You can then copy/paste the  
>> checkout line, and even make it into a local topic branch with the  
>> same name,
>>
>> git fetch http://review.source.kitware.com/p/ITK refs/changes/ 
>> 61/161/1 && git checkout FETCH_HEAD
>> git checkout -b GitAliases
>>
>> Using the simple command line below you can see what commits you  
>> have that are not yet merged into master,
>>
>> git log --oneline --graph origin/master..
>>
>> You can then compile and test these changes (if necessary), and  
>> even stage this topic branch in the case of commits coming from the  
>> community. Using the new aliases,
>>
>> git stage-push
>>
>> To merge the topic,
>>
>> git stage-merge
>>
>> Gerrit certainly needs some work to make topic branches simpler to  
>> deal with in the interface, but this level of interaction is  
>> already possible. It is how I work with Gerrit, and I have reviewed  
>> several lengthy topic branches using this workflow. I also wanted  
>> to point out that if you have Change-Id inserted as the last line  
>> of your commit message then,
>>
>> git push stage HEAD:refs/for/master
>>
>> Would be enough to update any commits you have changed on your  
>> topic branch, as Gerrit uses the Change-Id lines to resolve the  
>> newly pushed commits to the ones it has seen and update the patch  
>> sets accordingly. Thus, making it very simple to push an updated  
>> topic branch and keep all dependencies consistent.
>>
>> Hopefully this makes a few things clearer, I will be listening out  
>> for any more feedback/issues and look forward to meeting some of  
>> you at the ITK meeting.
>>
>> Marcus
>> --
>> Marcus D. Hanwell, Ph.D.
>> R&D Engineer, Kitware Inc.
>> (518) 881-4937
>> _______________________________________________
>> Powered by 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
>
> -- 
> Gaëtan Lehmann
> Biologie du Développement et de la Reproduction
> INRA de Jouy-en-Josas (France)
> tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
> http://voxel.jouy.inra.fr  http://www.itk.org
> http://www.mandriva.org  http://www.bepo.fr
>
> _______________________________________________
> Powered by 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

-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr  http://www.itk.org
http://www.mandriva.org  http://www.bepo.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: Ceci est une signature ?lectronique PGP
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20101016/fcf58b3a/attachment-0001.pgp>


More information about the Insight-developers mailing list