lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: accidental reverts in git


From: Janek Warchoł
Subject: Re: accidental reverts in git
Date: Fri, 11 Jul 2014 23:48:40 +0200

2014-07-11 18:42 GMT+02:00 David Kastrup <address@hidden>:
> Mark Polesky <address@hidden> writes:
>
>> In response to http://code.google.com/p/lilypond/issues/detail?id=3952#c7
>>
>> David, here's a simplified version of the faulty workflow.
>> The problem occurs in step 5 where I accidentally did
>> `HEAD..bar' instead of `master..bar' (thinko).
>
>> 1) git log --graph --all --decorate --oneline | cat
>>
>> * a9af02f (bar) Finish fixing bar.
>> * d3b60de Start fixing bar.
>> | * 38e720f (foo) Fix foo.
>> |/
>> * 9491de4 (HEAD, staging, master) HEAD of master branch.
>>
>> 2) git co staging
>> 3) git cherry-pick foo
>> 4) git log --graph --all --decorate --oneline | cat
>>
>> * c7b770d (HEAD, staging) Fix foo.
>> | * a9af02f (bar) Finish fixing bar.
>> | * d3b60de Start fixing bar.
>> |/
>> | * 38e720f (foo) Fix foo.
>> |/
>> * 9491de4 (master) HEAD of master branch.
>>
>> 5) git diff HEAD..bar > patch0.patch
>> 6) git apply patch0.patch
>> 7) git commit -am"Fix bar."
>
> No.  No, no, no.  _Never_ convert anything into a patch which you then
> apply.  You lose all context, and Git loses all context, patch authors,
> patch dates etc.  If you do "git reflog", you cannot reconstruct what
> happened as the source of the basically anonymous patch is opaque.

Oh my.  David's right - this workflow is completely un-gitish.  Would
you like a quick git coaching session?  I should have half an hour
tomorrow for a quick skype call, somewhere between 8 and 11UTC.

best,
Janek



reply via email to

[Prev in Thread] Current Thread [Next in Thread]