Skip to content

Conversation

newren
Copy link

@newren newren commented Jul 21, 2025

Changes since v2:

  • Modify comment to note testfile as well as testcase name; thanks to Junio for spotting
  • Clarify comment about skipping rename-to-self cases in process_renames() in the second-to-last patch; I meant to do this as part of v2 but forgot.
  • Add a new commit which clarifies the comment in merge_options_internal about the interning of strings in the "path" member.

Changes since v1; many thanks to Patrick for reviewing v1 in detail:

  • Several commit message cleanups
  • Make the test in patch 3 have a single expectation while documenting that a reasonable alternative exists, instead of trying to document that both are valid and having the test accept both outcomes
  • Moved a hunk accidentally squashed into patch 4 back to patch 3, and adjusted a nearby incorrect comment related to the squashed change
  • Fix style issues (grep -> test_grep, // -> /* */)

Original cover letter:

At GitHub, we've got a real-world repository that has been triggering failures of the form:

git: merge-ort.c:3007: process_renames: Assertion `newinfo && !newinfo->merged.clean' failed.

Digging in, this particular corner case requires multiple things to trigger: (1) a rename/delete of one file, and (2) a directory rename modifying an unrelated rename such that this unrelated rename's target becomes the source of the rename/delete from (1).

Unfortunately, looking around, it's not the only bug in the area. Plus, some of our testcases in tangential situations were not checked closely enough or were weird or buggy in various ways. Adding to the challenge was the fact that the relevant renames optimization was sometimes triggering making renames look like delete-and-add, and overlooking this meant I sometimes wasn't triggering what I thought I was triggering.

The combination of challenges sometimes made me think my fixes were breaking things when sometimes I was just unaware of other bugs. I went in circles a few times and took a rather non-linear path to finding and fixing these issues. While I think I've turned it into a nice linear progression of patches, I might be a bit too deep in the mud and it might not be as linear or clear as I think. Let me know and I'll try to clarify anything needed.

cc: Patrick Steinhardt [email protected]
cc: Elijah Newren [email protected]

newren added 2 commits July 16, 2025 15:48
In commit 919df31 (Collect merge-related tests to t64xx,
2020-08-10), merge related tests were moved from t60xx to t64xx.  Some
comments in merge-ort relating to some tricky code referenced specific
testcases within certain testfiles for additional information, but
referred to their historical testfile names; update the testfile names
to mention their modern location.

Signed-off-by: Elijah Newren <[email protected]>
check_for_directory_rename() had a weirdly coded check for whether a
strmap contained a certain key.  Replace the temporary variable and call
to strmap_get_entry() with the more natural strmap_contains() call.

Signed-off-by: Elijah Newren <[email protected]>
@newren
Copy link
Author

newren commented Jul 22, 2025

/submit

Copy link

gitgitgadget bot commented Jul 22, 2025

Submitted as [email protected]

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-1943/newren/fix-rename-corner-cases-v1

To fetch this version to local tag pr-1943/newren/fix-rename-corner-cases-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-1943/newren/fix-rename-corner-cases-v1

Copy link

gitgitgadget bot commented Jul 22, 2025

This patch series was integrated into seen via git@3904e22.

@gitgitgadget gitgitgadget bot added the seen label Jul 22, 2025
Copy link

gitgitgadget bot commented Jul 23, 2025

This branch is now known as en/ort-rename-fixes.

Copy link

gitgitgadget bot commented Jul 23, 2025

This patch series was integrated into seen via git@9888a97.

Copy link

gitgitgadget bot commented Jul 24, 2025

This patch series was integrated into seen via git@b0cd9b0.

Copy link

gitgitgadget bot commented Jul 24, 2025

There was a status update in the "Cooking" section about the branch en/ort-rename-fixes on the Git mailing list:

Various bugs about rename handling in "ort" merge strategy have
been fixed.

Comments?
source: <[email protected]>

Copy link

gitgitgadget bot commented Jul 24, 2025

This patch series was integrated into seen via git@996ae55.

Copy link

gitgitgadget bot commented Jul 25, 2025

This patch series was integrated into seen via git@bcdf9ae.

Copy link

gitgitgadget bot commented Jul 28, 2025

This patch series was integrated into seen via git@2b1b913.

Copy link

gitgitgadget bot commented Jul 28, 2025

This patch series was integrated into seen via git@9bf31d0.

Copy link

gitgitgadget bot commented Jul 29, 2025

There was a status update in the "Cooking" section about the branch en/ort-rename-fixes on the Git mailing list:

Various bugs about rename handling in "ort" merge strategy have
been fixed.

Comments?
source: <[email protected]>

Copy link

gitgitgadget bot commented Jul 29, 2025

This patch series was integrated into seen via git@94ff0f2.

Copy link

gitgitgadget bot commented Jul 31, 2025

This patch series was integrated into seen via git@d90b430.

Copy link

gitgitgadget bot commented Aug 1, 2025

There was a status update in the "Cooking" section about the branch en/ort-rename-fixes on the Git mailing list:

Various bugs about rename handling in "ort" merge strategy have
been fixed.

Comments?
source: <[email protected]>

Copy link

gitgitgadget bot commented Aug 1, 2025

User Patrick Steinhardt <[email protected]> has been added to the cc: list.

Copy link

gitgitgadget bot commented Aug 1, 2025

On the Git mailing list, Patrick Steinhardt wrote (reply to this):

On Tue, Jul 22, 2025 at 03:23:05PM +0000, Elijah Newren via GitGitGadget wrote:
> At GitHub, we've got a real-world repository that has been triggering
> failures of the form:
> 
> git: merge-ort.c:3007: process_renames: Assertion `newinfo && !newinfo->merged.clean' failed.
> 
> 
> Digging in, this particular corner case requires multiple things to trigger:
> (1) a rename/delete of one file, and (2) a directory rename modifying an
> unrelated rename such that this unrelated rename's target becomes the source
> of the rename/delete from (1).
> 
> Unfortunately, looking around, it's not the only bug in the area. Plus, some
> of our testcases in tangential situations were not checked closely enough or
> were weird or buggy in various ways. Adding to the challenge was the fact
> that the relevant renames optimization was sometimes triggering making
> renames look like delete-and-add, and overlooking this meant I sometimes
> wasn't triggering what I thought I was triggering.
> 
> The combination of challenges sometimes made me think my fixes were breaking
> things when sometimes I was just unaware of other bugs. I went in circles a
> few times and took a rather non-linear path to finding and fixing these
> issues. While I think I've turned it into a nice linear progression of
> patches, I might be a bit too deep in the mud and it might not be as linear
> or clear as I think. Let me know and I'll try to clarify anything needed.

I had a read through this whole series and it looks plausible to me. I
won't claim to fully understand it though given that I don't have a lot
of experience with the whole merge machinery.

Patrick

Copy link

gitgitgadget bot commented Aug 1, 2025

This patch series was integrated into seen via git@d57bdb0.

Copy link

gitgitgadget bot commented Aug 1, 2025

This patch series was integrated into seen via git@0972ba1.

Copy link

gitgitgadget bot commented Aug 1, 2025

This patch series was integrated into seen via git@5e25ac3.

Copy link

gitgitgadget bot commented Aug 4, 2025

This patch series was integrated into seen via git@3fd440e.

Copy link

gitgitgadget bot commented Aug 4, 2025

There was a status update in the "Cooking" section about the branch en/ort-rename-fixes on the Git mailing list:

Various bugs about rename handling in "ort" merge strategy have
been fixed.

Expecting a reroll?
cf. <[email protected]>
source: <[email protected]>

Copy link

gitgitgadget bot commented Aug 4, 2025

This patch series was integrated into seen via git@d245864.

@newren newren force-pushed the fix-rename-corner-cases branch from 7238c8c to c2eef5e Compare August 6, 2025 18:18
Copy link

gitgitgadget bot commented Aug 6, 2025

This patch series was integrated into seen via git@066334c.

@newren
Copy link
Author

newren commented Aug 6, 2025

/submit

Copy link

gitgitgadget bot commented Aug 6, 2025

Submitted as [email protected]

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-1943/newren/fix-rename-corner-cases-v3

To fetch this version to local tag pr-1943/newren/fix-rename-corner-cases-v3:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-1943/newren/fix-rename-corner-cases-v3

Copy link

gitgitgadget bot commented Aug 7, 2025

This patch series was integrated into seen via git@480bbb7.

Copy link

gitgitgadget bot commented Aug 7, 2025

There was a status update in the "Cooking" section about the branch en/ort-rename-fixes on the Git mailing list:

Various bugs about rename handling in "ort" merge strategy have
been fixed.

Looking good.
source: <[email protected]>

Copy link

gitgitgadget bot commented Aug 7, 2025

This patch series was integrated into seen via git@ebd65fe.

Copy link

gitgitgadget bot commented Aug 8, 2025

This patch series was integrated into seen via git@9e2b32e.

Copy link

gitgitgadget bot commented Aug 9, 2025

There was a status update in the "Cooking" section about the branch en/ort-rename-fixes on the Git mailing list:

Various bugs about rename handling in "ort" merge strategy have
been fixed.

Will merge to 'next'?
source: <[email protected]>

Copy link

gitgitgadget bot commented Aug 10, 2025

This patch series was integrated into seen via git@1cb887e.

Copy link

gitgitgadget bot commented Aug 11, 2025

This patch series was integrated into seen via git@f331c9d.

Copy link

gitgitgadget bot commented Aug 12, 2025

This patch series was integrated into seen via git@9fb5b44.

Copy link

gitgitgadget bot commented Aug 12, 2025

There was a status update in the "Cooking" section about the branch en/ort-rename-fixes on the Git mailing list:

Various bugs about rename handling in "ort" merge strategy have
been fixed.

Will merge to 'next'?
source: <[email protected]>

Copy link

gitgitgadget bot commented Aug 13, 2025

There was a status update in the "Cooking" section about the branch en/ort-rename-fixes on the Git mailing list:

Various bugs about rename handling in "ort" merge strategy have
been fixed.

Will cook in 'next'.
source: <[email protected]>

Copy link

gitgitgadget bot commented Aug 14, 2025

This patch series was integrated into seen via git@3a3a1ee.

Copy link

gitgitgadget bot commented Aug 14, 2025

This patch series was integrated into next via git@02536ed.

@gitgitgadget gitgitgadget bot added the next label Aug 14, 2025
Copy link

gitgitgadget bot commented Aug 15, 2025

This patch series was integrated into seen via git@95ed8d3.

Copy link

gitgitgadget bot commented Aug 17, 2025

This patch series was integrated into seen via git@247153d.

Copy link

gitgitgadget bot commented Aug 18, 2025

There was a status update in the "Cooking" section about the branch en/ort-rename-fixes on the Git mailing list:

Various bugs about rename handling in "ort" merge strategy have
been fixed.

Will cook in 'next'.
source: <[email protected]>

Copy link

gitgitgadget bot commented Aug 18, 2025

There was a status update in the "Cooking" section about the branch en/ort-rename-fixes on the Git mailing list:

Various bugs about rename handling in "ort" merge strategy have
been fixed.

Will cook in 'next'.
source: <[email protected]>

Copy link

gitgitgadget bot commented Aug 20, 2025

This patch series was integrated into seen via git@2c3d3b1.

Copy link

gitgitgadget bot commented Aug 20, 2025

This patch series was integrated into seen via git@c2e47c7.

Copy link

gitgitgadget bot commented Aug 20, 2025

There was a status update in the "Cooking" section about the branch en/ort-rename-fixes on the Git mailing list:

Various bugs about rename handling in "ort" merge strategy have
been fixed.

Will merge to 'master'.
source: <[email protected]>

Copy link

gitgitgadget bot commented Aug 21, 2025

This patch series was integrated into seen via git@d1123cd.

Copy link

gitgitgadget bot commented Aug 21, 2025

This patch series was integrated into master via git@d1123cd.

Copy link

gitgitgadget bot commented Aug 21, 2025

This patch series was integrated into next via git@d1123cd.

@gitgitgadget gitgitgadget bot added the master label Aug 21, 2025
@gitgitgadget gitgitgadget bot closed this Aug 21, 2025
Copy link

gitgitgadget bot commented Aug 21, 2025

Closed via d1123cd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant