Skip to content

test(gix-diff): add optional detailed report to slider test - #2931

Open
Christoph Rüßler (cruessler) wants to merge 1 commit into
GitoxideLabs:mainfrom
cruessler:make-slider-test-more-granular
Open

test(gix-diff): add optional detailed report to slider test#2931
Christoph Rüßler (cruessler) wants to merge 1 commit into
GitoxideLabs:mainfrom
cruessler:make-slider-test-more-granular

Conversation

@cruessler

Copy link
Copy Markdown
Contributor

This is the first PR in my quest to bring gix-diff closer to git diff. Before making any changes, I want to first add proper diagnostics, in order to be able to split the larger problem of “diffs don't match” into smaller problems of “diffs don't match for this specific reason” and “there's these specific reasons that can cause a mismatch”. The individual reasons can then be tackled independently.

The first run on a corpus of sliders from the gitoxide repository itself already yielded interesting results (note that this is only an, albeit fairly large, subset of all the sliders produced by create-diff-cases):

❯ env GIX_DIFF_SLIDER_REPORT=1 cargo test -p gix-diff slider::baseline -- --nocapture
[…]
slider report

total cases: 3094
git no-indent baselines: 3094

Exact: 141 [4.56%]
LikelySliderOnlyMismatch: 2902 [93.79%]
OtherMismatch: 51 [1.65%]

likely slider-only details

multi-hunk/same-count/same-direction: 2299 [79.22% slider-only, 74.31% total]
single-hunk/pure-insertion/same-before-start/0: 427 [14.71% slider-only, 13.80% total]
single-hunk/modification/same-before-start/0: 128 [4.41% slider-only, 4.14% total]
single-hunk/pure-deletion/same-before-start/0: 48 [1.65% slider-only, 1.55% total]

first non-matching cases

[…]

In this example, it looks like there might be just a few specific reasons for the mismatches, and it looks like the majority of them is indeed slider-related. My next goal would to identify specific classes of mismatches to see whether they can be captured in corresponding baseline tests and potentially also be solved by the same code change(s).

Please let me know if I used the new commit message format correctly. 😉

This is the first commit in my quest to bring `gix-diff` closer to `git
diff`. Before making any changes, I want to first add proper
diagnostics, in order to be able to split the larger problem of "diffs
don't match" into smaller problems of "diffs don't match for this
specific reason" and "there's these specific reasons that can cause a
mismatch". The individual reasons can then be tackled independently.
@cruessler
Christoph Rüßler (cruessler) marked this pull request as ready for review August 19, 2026 20:08
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant