Understanding git cherry-pick
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi all-
In helping a coworker yesterday with a git cherry-pick operation, I found my mental model of cherry-pick seems to be flawed. Our goal was to cherry-pick one commit from the current development branch back to the stable release branch (we're still training everyone on the *correct* way to do maintenance fixes). Here's what happened:
$ git checkout release-branch $ git cherry-pick 8815f3a0c2c248db223e41b0538f0c48b45fe52d warning: too many files (created: 237 deleted: 2558), skipping inexact rename detection Automatic cherry-pick failed. After resolving the conflicts, mark the corrected paths with 'git add <paths>' or 'git rm <paths>' and commit the result with: git commit -c 8815f3a0c2c248db223e41b0538f0c48b45fe52d
git status reported the actual change we wanted from the commit applied cleanly; the conflicts were all added/deleted files between the two branches. The commit only modifies a single file, and the file exists with the same name on both branches.
So what's actually going on here? If the one changed file in the commit merged cleanly, why did the automatic cherry-pick fail? Why does cherry-pick even care about file differences between the two branches that aren't modified by the commit in question? Or is it user error?
Thanks,
Stephen
Quoted 10 lines · On Wed, 10 Nov 2010 09:04:29 -0500 (EST) Stephen Bash <[email protected]> wrote:
git status reported the actual change we wanted from the commit applied cleanly; the conflicts were all added/deleted files between the two branches. The commit only modifies a single file, and the file exists with the same name on both branches.
So what's actually going on here? If the one changed file in the commit merged cleanly, why did the automatic cherry-pick fail? Why does cherry-pick even care about file differences between the two branches that aren't modified by the commit in question? Or is it user error?
Which version are you using ? I had problem using anything < 1.7.3 when the cherry-pick happened between two branches where some files changed theirs types eg: a link become a file (But not the other way around)
See:
http://thread.gmane.org/gmane.comp.version-control.git/160717/focus=160717
Quoted 3 lines
Thanks,
Stephen
--
Camille Moncelier
http://devlife.org
----- Original Message -----
Quoted 13 lines
From: "Camille Moncelier" <[email protected]>
To: "Stephen Bash" <[email protected]>
Sent: Wednesday, November 10, 2010 2:43:23 PM
Subject: Re: Understanding git cherry-pickQuoted 5 lines · On Wed, 10 Nov 2010 09:04:29 -0500 (EST) Stephen Bash <[email protected]> wrote:
git status reported the actual change we wanted from the commit applied cleanly; the conflicts were all added/deleted files between the two branches. The commit only modifies a single file, and the file exists with the same name on both branches.
Quoted 7 lines
Quoted 5 lines
So what's actually going on here? If the one changed file in the commit merged cleanly, why did the automatic cherry-pick fail? Why does cherry-pick even care about file differences between the two branches that aren't modified by the commit in question? Or is it user error?
Which version are you using ?
1.7.3 on the machine I reproduced the issue on... My coworker has something post-1.7.2 but I'm not exactly sure.
Thanks,
Stephen