diff icon indicating copy to clipboard operation
diff copied to clipboard

Skip whitespace changes

Open robertoaloi opened this issue 1 year ago • 4 comments

Hi! Not sure if this is somehow available already, but it would be great to have the option not to display whitespace changes when comparing two versions:

https://diff.hex.pm/diff/redbug/2.0.9..2.1.0

robertoaloi avatar Oct 23 '24 13:10 robertoaloi

Thank you for the report. We don't have that yet but I think it'd be a nice addition. PRs welcome!

wojtekmach avatar Oct 23 '24 13:10 wojtekmach

What kind of whitespace changes do you want to ignore? We use git diff to build the diff, what flags would we pass to it get the expected result?

As a note GitHub also shows whitespace changes and I can't find an option to ignore it: https://github.com/massemanet/redbug/compare/2.0.7...2.0.10

ericmj avatar Nov 13 '24 17:11 ericmj

Hi @ericmj,

-w is the git diff option you want. The option is available via the w=1 query param on GitHub. So, for example, for the redbug_eunit:t_8_test/1 function:

https://github.com/massemanet/redbug/compare/2.0.7...2.0.10

Screenshot 2024-11-18 at 09 29 30

https://github.com/massemanet/redbug/compare/2.0.7...2.0.10?w=1

Screenshot 2024-11-18 at 09 29 49

Not sure why the option is not available via the GitHub UI.

robertoaloi avatar Nov 18 '24 08:11 robertoaloi

Thanks for the explanation, an option to skip whitespace in diffs definitely seems reasonable to support.

ericmj avatar Nov 25 '24 19:11 ericmj