The idea is to use https://github.com/mhagger/diff-slider-tools to create slider information for use to generate a test which invokes our own implementation and compares it to Git itself. Follow these instructions to set it up.
- DIFF_SLIDER_TOOLS=/your/anticipated/path/to/diff-slider-tools
git clone https://github.com/mhagger/diff-slider-tools $DIFF_SLIDER_TOOLSpushd $DIFF_SLIDER_TOOLS- Follow these instructions to generate a file containing the slider information. Be sure to set the
repovariable as it's used in later script invocations.- Note that
get-corpusmust be run with./get-corpus. - You can use an existing repository, for instance via
repo=git-human, so there is no need to find your own repository to test. - The script suite is very slow, and it's recommended to only set a range of commits, or use a small repository for testing.
- Note that
Finally, run the internal-tools program to turn that file into a fixture called make_diff_for_sliders_repo.sh.
# run inside `gitoxide`
popd
cargo run --package internal-tools -- \
create-diff-cases \
--sliders-file $DIFF_SLIDER_TOOLS/corpus/$repo.sliders \
--worktree-dir $DIFF_SLIDER_TOOLS/corpus/$repo.git/ \
--destination-dir gix-diff/tests/fixtures/Finally, run cargo test -p gix-diff sliders -- --nocapture to execute the actual tests to compare.