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

Re: Two bugs with renaming

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 20, 2008, 04:12 UTC
Message-ID
<alpine.LFD.1.00.0803192059120.3020@woody.linux-foundation.org>
In-Reply-To
<slrnfu37vn.d2i.jgoerzen@katherina.lan.complete.org>
On Wed, 19 Mar 2008, John Goerzen wrote:
Show 16 quoted lines
>
> #######
> # Set up bug #2
> 
> jgoerzen@katherina:/tmp/testrepo$ echo foo > foo
> jgoerzen@katherina:/tmp/testrepo$ git add foo
> jgoerzen@katherina:/tmp/testrepo$ git commit -m 'Added foo'
> jgoerzen@katherina:/tmp/testrepo$ git checkout testbranch
> Switched to branch "testbranch"
> jgoerzen@katherina:/tmp/testrepo$ ls -l
> total 0
> lrwxrwxrwx 1 jgoerzen jgoerzen 16 Mar 19 18:14 files -> /tmp/nonexistant
> drwxr-xr-x 2 jgoerzen jgoerzen 22 Mar 19 18:14 files.upstream
> jgoerzen@katherina:/tmp/testrepo$ git merge master
> fatal: Entry 'files/delete.me' would be overwritten by merge. Cannot merge.
> Merge with strategy recursive failed.

Ok, so if I read this right, you have a D/F conflict, with the current branch having a file (or rather, a symlink) called "files", and the branch you are trying to merge has a *directory* called "files" in it, and the merge gets really unhappy about that conflict.

Now, arguably, it should just see them as two independent issues, and then the rename detection will notice that the "files/delete.me" file got renamed as "files.upstream/delete.me", so *after* rename detection there will be no D/F conflict in the end result, but we see the conflict before that all even happens.

Ho humm. 

With the new unpack-trees logic it's pretty easy to *not* unpack with DF conflicts (add a flag that tells us to use "base_name_compare()" instead of "df_name_compare()" in do_compare_entry()), and maybe we can then make builtin-merge-recursive.c set that flag. But then builtin-merge-recursive would also have to understand about D/F conflicts itself (since now unpack_trees() wouldn't give them as conflicts any more).

			Linus
Previous: Björn SteinbrinkNext: Linus Torvalds
Message 7 of 9 in “Two bugs with renaming”
  1. John GoerzenMar 19, 2008
  2. Junio C HamanoMar 20, 2008
  3. Jeff KingMar 20, 2008
  4. John GoerzenMar 20, 2008
  5. Jeff KingMar 20, 2008
  6. Björn SteinbrinkMar 20, 2008
  7. Linus TorvaldsMar 20, 2008
  8. Linus TorvaldsMar 20, 2008
  9. Junio C HamanoMar 20, 2008

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.