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

Re: [PATCH 3/3] merge-recursive: handle rename-to-self case

From
Derrick Stolee <stolee@gmail.com>
Date
Jun 29, 2021, 12:55 UTC
Message-ID
<7854e7b7-f128-e389-cc06-8b599c7b3e32@gmail.com>
In-Reply-To
<xmqqeecl1foi.fsf@gitster.g>
On 6/29/2021 12:02 AM, Junio C Hamano wrote:
Show 18 quoted lines
> "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
> 
>> From: Elijah Newren <newren@gmail.com>
>>
>> Directory rename detection can cause transitive renames, e.g. if the two
>> different sides of history each do one half of:
>>     A/file -> B/file
>>     B/     -> C/
>> then directory rename detection transitively renames to give us
>>     A/file -> C/file
>>
>> However, when C/ == A/, note that this gives us
>>     A/file -> A/file.
> 
> Heh, of course this is recent because the "guess that directory B
> has been moved to C in its entirety" heuristic is quite new.
> 
> Nicely fixed and described.  Will queue.  Thanks.

I agree that the fixes in patches 2 and 3 are rather clean. The tests added in patch 1 provide significant confidence in the result, though I had a minor question about a possible third test case.

Seeing the solutions that make the two tests pass leaves me to consider that the third test case is likely unnecessary, because there is nothing special about how the directories are being renamed that must be handled by the fix.

Thanks, -Stolee

Previous: Junio C HamanoNext: Elijah Newren via GitGitGadget
Message 8 of 12 in “Fix bugs from interesting renaming pairs: one side renames A/file -> B/file, the other B/ -> A/”
  1. 0/3 Fix bugs from interesting renaming pairs: one side renames A/file -> B/file, the other B/ -> A/Elijah Newren via GitGitGadget, Jun 26, 2021
  2. 1/3 t6423: test directory renames causing rename-to-selfElijah Newren via GitGitGadget, Jun 26, 2021
  3. Derrick StoleeJun 29, 2021
  4. Elijah NewrenJun 30, 2021
  5. 2/3 merge-ort: ensure we consult df_conflict and path_conflictsElijah Newren via GitGitGadget, Jun 26, 2021
  6. 3/3 merge-recursive: handle rename-to-self caseElijah Newren via GitGitGadget, Jun 26, 2021
  7. Junio C HamanoJun 29, 2021
  8. Derrick StoleeJun 29, 2021
  9. 0/3 Fix bugs from interesting renaming pairs: one side renames A/file -> B/file, the other B/ -> A/Elijah Newren via GitGitGadget, Jun 30, 2021
  10. 1/3 t6423: test directory renames causing rename-to-selfElijah Newren via GitGitGadget, Jun 30, 2021
  11. 2/3 merge-ort: ensure we consult df_conflict and path_conflictsElijah Newren via GitGitGadget, Jun 30, 2021
  12. 3/3 merge-recursive: handle rename-to-self caseElijah Newren via GitGitGadget, Jun 30, 2021

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.