Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR should improve the diff quality as it introduces a
Sinkthat calculates Git diffs with hunks similar to whatxdiffdoes.At least in theory, as I didn't vet the algorithm, just the implementation.
This makes using the new
Sinka bit of a leap of faith, as it uses enough slice-indices to make panics quite possible. There is also not a lot of tests, nor is there a fuzzer setup, so anything could happen.Ideally, it will just work though, and if it gives trouble it should be easy to revert the commit.
It will probably be used in
batsoon: sharkdp/bat#3235 (comment).And lastly, here is two diffs that show where the new algorithm differs - the slider is at the bottom of the diff, and the upper diff is more desirable thanks to the new algorithm.
Tasks
gixforGitDiffSinkSinkwhen creating unified diffs