github GitoxideLabs/gitoxide gix-imara-diff-v0.3.0
gix-imara-diff v0.3.0

7 hours ago

Bug Fixes

  • track end of file and trailing blanks the way git does
    Two bugs that were propping each other up.

    git tracks end of file positionally. measure_split sets end_of_file when
    split >= nrec, meaning the split sits past the last line, and that flag is
    the only thing END_OF_FILE_PENALTY keys off. Indents had no such flag, so
    score() inferred it from content instead: next_indent == BLANK && trailing_blanks == 0.

  • round sqrt approximation the same way as xdl_bogosqrt
    sqrt() rounds the halved bit count down, where git's xdl_bogosqrt rounds it up:

    for (i = 1; n > 0; n >>= 2) i <<= 1;
    

    For every odd bit length it halves the result. A 450-line file gets a limit
    of 16 instead of git's 32, so a line occurring 27 times is treated as too
    frequent to be worth matching and becomes a candidate for discarding, while git
    treats it as ordinary and matches it. The same value is the cost ceiling the
    Myers search gives up at, which was likewise half of git's.

  • count candidate lines the way xdl_clean_mmatch does
    Before running Myers, a frequent line is discarded only when it sits inside a
    run of lines that match nothing. Git decides that in xdl_clean_mmatch
    (xdiff/xprepare.c), where the backward and forward scans each start their
    frequent-line counter at 1, so the line under test contributes 2 to the total:

    for (r = 1, rdis0 = 0, rpdis0 = 1; (i - r) >= s; r++) { ... }
    for (r = 1, rdis1 = 0, rpdis1 = 1; (i + r) <= e; r++) { ... }
    rdis1 += rdis0; rpdis1 += rpdis0;
    return rpdis1 * XDL_KPDIS_RUN < (rpdis1 + rdis1);
    

    should_prune_common_line started both counters at 0 and started its forward
    loop beginning at the line itself, so it contributed 1. The threshold for
    discarding was therefore an unmatched run longer than 3 rather than longer
    than 6, and a discarded line can never be matched, costing one removal and
    one insertion against git's answer each time.

Changed (BREAKING)

  • raise MSRV to Rust 1.88

    The newly published dua-core 3.3 release used by linked-worktree removal
    requires Rust 1.88, so raise every workspace crate and the advertised badge
    together.

    Keep the MSRV checks buildable by selecting the latest sysinfo and rusqlite
    release lines that support Rust 1.88.

Commit Statistics

  • 8 commits contributed to the release over the course of 33 calendar days.
  • 34 days passed between releases.
  • 4 commits were understood as conventional.
  • 0 issues like '(#ID)' were seen in commit messages

Commit Details

view details
  • Uncategorized
    • Merge pull request #2987 from tcrypt25519/tcrypt/diff-parity-fixes (7665437)
    • Review (929df61)
    • Track end of file and trailing blanks the way git does (f48f94d)
    • Round sqrt approximation the same way as xdl_bogosqrt (4d137c3)
    • Count candidate lines the way xdl_clean_mmatch does (b813b00)
    • Merge pull request #2949 from GitoxideLabs/error-conversion-review (a095334)
    • Raise MSRV to Rust 1.88 (4b42e0c)
    • Merge pull request #2933 from GitoxideLabs/report-august (b8914ff)

Don't miss a new gitoxide release

NewReleases is sending notifications on new releases.