git/list[1] front-page[2] threads[3] people[4] search[5] about
 

unexpected git-cherry-pick conflict

From
Gerrit Pape <pape@smarden.org>
Date
Jun 13, 2007, 09:16 UTC
Message-ID
<20070613091624.26463.qmail@353090644b4917.315fe32.mid.smarden.org>
In-Reply-To
<6b8a91420706070252y3fd581a3w427d91e5b982d29d@mail.gmail.com>
On Thu, Jun 07, 2007 at 11:52:19AM +0200, Remi Vanicat wrote:
Show 7 quoted lines
> how to reproduce :
> create a repos with a link in it, then in a branch, remove the link,
> and add a directory in place of the link (same name).
> 
> Then try to cherry pick a commit from a branch where there is the
> directory into a branch where there is the link : it failed even if
> the modification ave nothing to do with said link/directory.
Hi, please see http://bugs.debian.org/417885

This is how I can reproduce the conflict, and I too didn't expect that. The link/dir that conflicts is not changed in the commit that's cherry-pick'ed:

 $ mkdir repo && cd repo
 $ git init
 Initialized empty Git repository in .git/
 $ echo foo >file
 $ ln -s dangling link
 $ git add .
 $ git commit -mfoo
 Created initial commit c6a9189: foo
  2 files changed, 2 insertions(+), 0 deletions(-)
  create mode 100644 file
  create mode 120000 link
 $ git checkout -b branch
 Switched to a new branch "branch"
 $ git rm link
 rm 'link'
 $ git commit -mremovelink
 Created commit 2c60f15: removelink
  1 files changed, 0 insertions(+), 1 deletions(-)
  delete mode 120000 link
 $ mkdir link
 $ echo bar >link/file
 $ git add link
 $ git commit -m adddir
 Created commit d3b30b5: adddir
  1 files changed, 1 insertions(+), 0 deletions(-)
  create mode 100644 link/file
 $ echo bar >>file
 $ git commit -mfile file
 Created commit 8ddc4d5: file
  1 files changed, 1 insertions(+), 0 deletions(-)
 $ 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
 Automatic cherry-pick failed.  After resolving the conflicts,
 mark the corrected paths with 'git-add <paths>'
 and commit the result.
 When commiting, use the option '-c 8ddc4d5' to retain authorship and
 message.
 $ 
Thanks, Gerrit.
Next: Johannes Schindelin
Message 1 of 23 in “unexpected git-cherry-pick conflict”
  1. Gerrit PapeJun 13, 2007
  2. Johannes SchindelinJun 13, 2007
  3. Gerrit PapeJun 13, 2007
  4. Johannes SchindelinJun 13, 2007
  5. Gerrit PapeJun 25, 2007
  6. Johannes SchindelinJun 25, 2007
  7. Johannes SchindelinJul 7, 2007
  8. Gerrit PapeDec 21, 2007
  9. Junio C HamanoDec 22, 2007
  10. merge-tree: sometimes, d/f conflict is not an issueJohannes Schindelin, Jul 8, 2007
  11. Junio C HamanoJul 8, 2007
  12. Johannes SchindelinJul 8, 2007
  13. Johannes SchindelinJul 8, 2007
  14. Johannes SchindelinJul 8, 2007
  15. Junio C HamanoJul 8, 2007
  16. Junio C HamanoJul 8, 2007
  17. Johannes SchindelinJul 8, 2007
  18. Junio C HamanoJul 8, 2007
  19. merge-one-file, was Re: [PATCH] merge-tree: sometimes, d/f conflict is not an issueJohannes Schindelin, Jul 9, 2007
  20. 1/2 merge-recursive: sometimes, d/f conflict is not an issueJohannes Schindelin, Jul 17, 2007
  21. Gerrit PapeAug 8, 2007
  22. 2/2 Add tests for cherry-pick d/f conflict which should be noneJohannes Schindelin, Jul 17, 2007
  23. Johannes SchindelinJul 8, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.