github GitoxideLabs/gitoxide gix-merge-v0.19.0
gix-merge v0.19.0

4 hours ago

Bug Fixes

  • prefer file-name matches when pairing rename candidates, like Git
    When several sources are equally viable for a destination - identical ids in the identity pass, or equal similarity in the similarity pass - prefer the one whose file name matches the destination's, in the spirit of Git's basename-driven matching. This makes the now-deterministic choice also the semantically better one, where previously the pairing among identical candidates was arbitrary.

    The tree-merge baseline had recorded the arbitrary pairings in its three deviating cases, along with their consequences. These expectations are updated to the improved outcomes:

    • rename-within-rename-2: both merge directions now produce the same cleanly merged tree - the result that was previously present but commented out in favor of the order-dependent conflict, making the merge reversible as intended. The expected-reversed workaround branch is no longer needed.
    • conflicting-rename-complex (both directions): contents follow their true renames now that files pair up by name, and the previously documented mismatch of finding a rename of a/w to a-renamed/z no longer happens. Forward and reversed merges produce the same tree and mirror-image conflict stages.

    All other 114 baseline cases are unchanged, in SHA-1 and SHA-256. Note that in the identity pass, when no file-name match exists, the scan now covers the whole same-id range before falling back to the first eligible candidate, where it stopped previously.

  • keep file/directory merges independent of the object hash
    When one side edits a file and the other replaces it with a directory,
    the merge finds the replacement by checking only the next change after
    the deletion, assuming the dir's addition is adjacent to it.

    That adjacency is an accident of SHA-1: rename-detection orders changes
    by object-id and the addition lands next to the deletion.

    Switching to SHA-256 changes every id and reorders the diff, moving the
    addition elsewhere, so a merge that resolved cleanly under SHA-1 missed
    the replacement under SHA-256, left the file in place and panicked.

    In other words, what happens is that the same input gives a different
    merge result due to the hash algo.

    Instead of looking just at the next change, scan all of that side's
    changes so the outcome no longer depends on the object-id order.

Commit Statistics

  • 17 commits contributed to the release.
  • 31 days passed between releases.
  • 2 commits were understood as conventional.
  • 1 unique issue was worked on: #1832

Commit Details

view details
  • #1832
    • Prefer file-name matches when pairing rename candidates, like Git (cea5ea7)
  • Uncategorized
    • Update changelogs prior to release (cb6ec7d)
    • Release gix-trace v0.1.21, gix-validate v0.11.3, gix-path v0.12.3, gix-utils v0.3.5, gix-config-value v0.19.0, gix-prompt v0.16.0, gix-sec v0.14.2, gix-url v0.37.0, gix-credentials v0.39.0, safety bump 18 crates (f0ec710)
    • Merge pull request #2737 from GitoxideLabs/encoding-fallback-pony (2315ede)
    • Adapt to changes in gix-filter (552402f)
    • Merge pull request #2722 from GitoxideLabs/reasons (c16b5a1)
    • Replace lint allowances with expectations (43ff87a)
    • Merge pull request #2714 from GitoxideLabs/fix-credentials-parsing (cf3053a)
    • Release gix-path v0.12.2, gix-error v0.2.5, gix-utils v0.3.4, gix-date v0.15.6, gix-url v0.36.2, gix-credentials v0.38.2 (27aec47)
    • Merge pull request #2687 from ameyypawar/fix/1832-rename-tracker-order-independent (a82b492)
    • Review (32cb1ad)
    • Use gix_odb::memory::Proxy<gix_object::Never> where applicable (3880993)
    • Merge pull request #2677 from 10ne1/dev/aratiu/sha256-merge (63f86a4)
    • Review (3f8754c)
    • Make the tree-baseline tests hash-aware (02f2383)
    • Keep file/directory merges independent of the object hash (ce9cff4)
    • Merge pull request #2646 from GitoxideLabs/report (1b1541e)

Don't miss a new gitoxide release

NewReleases is sending notifications on new releases.