Thread (13 messages) flat view 13 messages, 3 authors, 2016-06-15

Re: unexpected git-cherry-pick conflict

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:43:16

Possibly related (same subject, not in this thread)

Hi,

On Wed, 13 Jun 2007, Gerrit Pape wrote:
On Wed, Jun 13, 2007 at 01:58:51PM +0100, Johannes Schindelin wrote:
quoted
On Wed, 13 Jun 2007, Gerrit Pape wrote:
quoted
 $ git checkout master
 Switched to branch "master"
 $ git cherry-pick 8ddc4d5
 CONFLICT (file/directory): There is a directory with name link in
 8ddc4d5... file. Added link as link~HEAD
Here you _still_ have the file in master. So that conflict is really 
expected, since a cherry-pick will only do a three-way merge.
git-cherry-pick(1) states
 Given one existing commit, apply the change the patch introduces, and
 record a new commit that records it. This requires your working tree to
 be clean (no modifications from the HEAD commit).

The patch introduced by the commit that's cherry-pick'ed has nothing to
do with the link or new directory, it just changes 'file'

 $ git show 8ddc4d5
 commit 8ddc4d59444a362261e10a3b22324818f5dd2fa7
 Author: Gerrit Pape [off-list ref]
 Date:   Wed Jun 13 09:10:30 2007 +0000
 
     file
 
 diff --git a/file b/file
 index 257cc56..3bd1f0e 100644
 --- a/file
 +++ b/file
 @@ -1 +1,2 @@
  foo
 +bar
 $ 

The patch applies to master just fine.  Where's my thinking wrong?
Hmm. Indeed. Thanks for clearing that up. Will work on it later.

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help