rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.77k stars 12.77k forks source link

Use `git diff --no-index` as the default diff in compiletest #132602

Open Noratrieb opened 2 weeks ago

Noratrieb commented 2 weeks ago

Since not long ago, compiletest supports custom diffing tools in the config. This is cool, but in practice probably not very used since it requires configuring it. I think that compiletest should, when git is available, use git diff --no-index by default as the diff. The default git diff is quite OK, and many people (me included) configure git to have an even prettier one. This way, people get a nice diff by default without configuring anything.

jieyouxu commented 2 weeks ago

Remark: if someone is trying to tackle this, please remember that there should be a distinction for how the visual diff intended for test writer is generated vs how the checked in diff from snapshots is generated