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

Re: [PATCH 1/3] t3030: fix accidental success in symlink rename

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 25, 2011, 17:42 UTC
Message-ID
<7v1v1v6qs2.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20110325160326.GA26635@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> In this test, we have merge two branches. On one branch, we
> renamed "a" to "e". On the other, we renamed "a" to "e" and
> then added a symlink pointing at "a" pointing to "e".

I read this five times but still couldn't figure out that you meant that the other side 'added a symlink "a" to allow people keep referring to "e" with the old name "a"' until I actually read the actual test you are describing here.

Besides, /we have merge/s/have//, I think.
Show 12 quoted lines
> The results for the test indicate that the merge should
> succeed, but also that "a" should no longer exist. Since
> both sides renamed "a" to the same destination, we will end
> up comparing those destinations for content.
>
> But what about what's left? One side (the rename only),
> replaced "a" with nothing. The other side replaced it with a
> symlink. The common base must also be nothing, because any
> "a" before this was meaningless (it was totally unrelated
> content that ended up getting renamed).
>
> The only sensible resolution is to keep the symlink.
I agree.

We should treat structural changes and do a 3-way on that, and then another 3-way on content changes, treating them as an independent thing. One side has "create 'e' out of 'a', removing 'a'" and "_create_ 'a', that is unrelated to the original 'a'", the other side has "create 'e' out of 'a', removing 'a'", so the end result should be that we do both, i.e. "create 'e' out of 'a', removing 'a'" and "create 'a'". At the content level, the result in 'e' may have to be decided by 3-way. The result in 'a' should be a clean merge taken from the former "with b/c link" branch, as this is not even a create (by the side that added a backward compatibility symbolic link) vs a delete (by pure-rename side) conflict.

Previous: Jeff KingNext: Jeff King
Message 7 of 14 in “merge recursive and code movement”
  1. Jay SoffianMar 24, 2011
  2. Jeff KingMar 25, 2011
  3. Jeff KingMar 25, 2011
  4. Jeff KingMar 25, 2011
  5. Jeff KingMar 25, 2011
  6. 1/3 t3030: fix accidental success in symlink renameJeff King, Mar 25, 2011
  7. Junio C HamanoMar 25, 2011
  8. Jeff KingMar 25, 2011
  9. Schalk, KenMar 25, 2011
  10. 2/3 merge: handle renames with replacement contentJeff King, Mar 25, 2011
  11. 3/3 merge: turn on rewrite detectionJeff King, Mar 25, 2011
  12. Jay SoffianMar 25, 2011
  13. Techlive ZhengJul 16, 2012
  14. Jeff KingJul 16, 2012

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.