git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Tracking cherry picks
@ 2011-10-20 14:21 Phillip Susi
  2011-10-20 15:00 ` Kirill Likhodedov
  2011-10-21  9:52 ` Jonathan Nieder
  0 siblings, 2 replies; 4+ messages in thread
From: Phillip Susi @ 2011-10-20 14:21 UTC (permalink / raw)
  To: git

I need to maintain a few stable release branches in addition to the 
master branch.  Sometimes a bug is found and the fix needs applied to 
multiple branches.  I would like to be able to list what branches the 
fix has been applied to to validate that it went in everywhere it was 
needed, but after cherry-picking the fix from master to the stable 
branches, the SHA1 of the commit is different, and so git branch 
--contains does not think the commit was applied to each of the stable 
branches.

Is there a way around this?  Why doesn't git-cherrypick record the 
original SHA1 it was picked from in the commit?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Tracking cherry picks
  2011-10-20 14:21 Tracking cherry picks Phillip Susi
@ 2011-10-20 15:00 ` Kirill Likhodedov
  2011-10-20 15:34   ` Ramkumar Ramachandra
  2011-10-21  9:52 ` Jonathan Nieder
  1 sibling, 1 reply; 4+ messages in thread
From: Kirill Likhodedov @ 2011-10-20 15:00 UTC (permalink / raw)
  To: Phillip Susi; +Cc: git



20.10.2011, в 18:21, Phillip Susi:
>  Why doesn't git-cherrypick record the original SHA1 it was picked from in the commit?

It does if you specify "-x" option to cherry-pick
See the man for git-cherry-pick:

-x
           When recording the commit, append a line that says "(cherry picked from commit ...)" to the
           original commit message in order to indicate which commit this change was cherry-picked from.
           This is done only for cherry picks without conflicts. Do not use this option if you are
           cherry-picking from your private branch because the information is useless to the recipient. If
           on the other hand you are cherry-picking between two publicly visible branches (e.g. backporting
           a fix to a maintenance branch for an older release from a development branch), adding this
           information can be useful.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Tracking cherry picks
  2011-10-20 15:00 ` Kirill Likhodedov
@ 2011-10-20 15:34   ` Ramkumar Ramachandra
  0 siblings, 0 replies; 4+ messages in thread
From: Ramkumar Ramachandra @ 2011-10-20 15:34 UTC (permalink / raw)
  To: Kirill Likhodedov; +Cc: Phillip Susi, git

Hi,

Kirill Likhodedov writes:
> 20.10.2011, в 18:21, Phillip Susi:
>>  Why doesn't git-cherrypick record the original SHA1 it was picked from in the commit?
>
> It does if you specify "-x" option to cherry-pick
> See the man for git-cherry-pick:
> [...]

Right.  As an interesting historical note, git has been omitting the
original object name by default when cherry-picking/ reverting since
abd6970a (cherry-pick: make -r the default, 2006-10-05).

-- Ram

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Tracking cherry picks
  2011-10-20 14:21 Tracking cherry picks Phillip Susi
  2011-10-20 15:00 ` Kirill Likhodedov
@ 2011-10-21  9:52 ` Jonathan Nieder
  1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Nieder @ 2011-10-21  9:52 UTC (permalink / raw)
  To: Phillip Susi; +Cc: git, Kirill Likhodedov, Ramkumar Ramachandra

Hi,

Phillip Susi wrote:

> Sometimes a bug is found and the fix needs applied to multiple
> branches.  I would like to be able to list what branches the fix has been
> applied to to validate that it went in everywhere it was needed, but after
> cherry-picking the fix from master to the stable branches, the SHA1 of the
> commit is different, and so git branch --contains does not think the commit
> was applied to each of the stable branches.

If you base the fix on the oldest commit you think you might ever want to
apply it to, then you can reuse the same bugfix commit in all branches.
See gitworkflows(7) for more on this.

Hope that helps, and good luck,
Jonathan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-21  9:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-20 14:21 Tracking cherry picks Phillip Susi
2011-10-20 15:00 ` Kirill Likhodedov
2011-10-20 15:34   ` Ramkumar Ramachandra
2011-10-21  9:52 ` Jonathan Nieder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).