Document where git diff and gix-imara-diff diverge and potentially narrow the gap
#2833
Christoph Rüßler (cruessler)
announced in
Tasks
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This is a tracking issue related to what’s known as the “diff slider problem”. When calculating the diff between two versions of a file, a hunk can be ambiguous with respect to where it starts and ends. Consider the following example:
fn test_a_different_thing() { } +#[test] +fn test_something() { +} + #[test] fn test_something_else() { }The following diff is, technically speaking, equally valid, even though human readers most likely would prefer the above diff.
fn test_a_different_thing() { } #[test] +fn test_something() { +} + +#[test] fn test_something_else() { }gix-diffrelies ongix-imara-diff(ported fromimara-diff0.2) under the hood for it’s diffing algorithm. There’s a certain number of cases, though, wheregix-imara-diffandgit diffyield different results as they employ different heuristics with respect to moving ambiguous diff hunks up or down. This number used to be bigger whengix-diffwas still usingimara-diff0.1.We assume that most people would expect
gix-diffto yield the same results asgit diff. Based on this assumption, we want to track progress towards closing the gap betweengix-diffandgit diffwith respect to slider placement.Tasks
gix-diff/testsofgix-imara-diff/testsgix-imara-diffmatchesgit diffSources
https://github.com/mhagger/diff-slider-tools
Related
blame-experimentaltogix#2307imara-diff0.2 in diff slider test #2288gix-blametoimara-diff0.2 #2287expectrlandimara-difffrom grouped version updates #2269gix-diff#2197All reactions