[Insight-developers] Learning from my mistakes (an adventure in git)

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Mon Aug 2 10:51:23 EDT 2010


Le 2 août 10 à 16:29, Hans Johnson a écrit :

> Brad,
>
> I like this solution!  I think it covers a very common case where  
> developers
> who need to do a quick fix turn to their existing dashboard builds  
> to test
> something out.
>
> This information is very helpful.
>

Really useful for sure!
Would it be possible to fetch the hooks automatically (at least try  
to, if the network in not available at this time)?

I don't see any style check for now. Is it the expected behavior?

Gaëtan


> Hans
>
>
>
> On 8/2/10 8:35 AM, "Brad King" <brad.king at kitware.com> wrote:
>
>> On 08/01/2010 05:15 PM, Hans Johnson wrote:
>>> Would it be possible to have the itk_common.cmake setup the git  
>>> hooks by
>>> default?
>>
>> That script is for creating dashboard builds, not developer clones.
>> I prefer to keep it focused.  However, I just pushed out a change
>> to handle this:
>>
>>  http://itk.org/gitweb?p=ITK.git;a=commitdiff;h=311e2ee1
>>
>> Now after running CMake if you try to commit to your ITK clone it
>> will fail with instructions to install the hooks.  This should  
>> prevent
>> folks from accidentally creating commits without the local hooks.
>>
>>> Problems that I ran into:
>>> 1) I forgot to setup the commit hooks, and some of my commits did  
>>> not pass
>>> that test.
>>
>> The above should handle this in the future.
>>
>>> 2) I had the wrong e-mail address listed, so I wanted to fix that.
>>
>> One of the local hooks verifies that you have *an* email address set.
>> If you had the wrong one you can fix the most recent commit using
>>
>>  git commit --amend --reset-author
>>
>> after fixing your "~/.gitconfig".  To fix more commits, use "git  
>> rebase -i"
>> and change the "pick" lines to "edit".
>>
>>> 3) I did not understand the branching mechanisms of git very well,  
>>> so I ended
>>> up with a bit of a mess.
>>
>> Have things cleared up for you?  The way I keep track of things is to
>> always remember that history is a *graph* (DAG).  Git's "branches"  
>> are
>> really just references to nodes in the graph.  A commit on a branch  
>> just
>> creates a new node and moves the branch reference forward to it.
>>
>> 4) Off-by-one error in the index for problem 5 :)
>>
>>> 5) My intermediate commits needed to be re-ordered to fit into a  
>>> more logical
>>> commit structure.
>> [snip]
>>> In order to do this, I took my non-logical branches, and created a
>>> complete patch set from them to disk, and then started re-importing
>>> the patches in a organized progression.
>>
>> FYI, your procedure can be simplified using
>>
>>  git rebase -i
>>
>> and
>>
>>  git rebase --whitespace=fix
>>
>> -Brad
>
> -- 
> Hans J. Johnson, Ph.D.
> Assistant Professor
> 200 Hawkins Drive
> T205 BT, The University of Iowa
> Iowa City, IA 52242
>
> hans-johnson at uiowa.edu
> PHONE: 319 353 8587
>
> _______________________________________________
> 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/20100802/2f178577/attachment.pgp>


More information about the Insight-developers mailing list