Highlight whitespace-only differences in text data
This bug was originally reported by Paul Wise (@pabs) in Debian bug #1022210:
Package: diffoscope
Version: 224
Severity: wishlist
It would be nice if diffoscope could help highlight that text data
differ only in the whitespace or if they differ in the text too.
The proposal would be that by default diffoscope would use wdiff (or
similar) to compare all line based text buffers (including those
converted from other formats) in order to check for whitespace-only
differences. When there are non-whitespace differences then display the
wdiff (or similar) output, with a comment saying these are differences
in the text after ignoring whitespace. In situations where the text
buffer differs only by whitespace, diffoscope would do a line diff of
the text buffer itself, with a comment saying the text of the two text
buffers was not different and only whitespace changes were present.
Since this check probably won't be useful for all diffs of line based
text buffers, probably there will need to be various heuristics for
when to apply it and when not to apply it, perhaps starting with
applying it to everything and then adding exceptions over time.
This would be useful in some situations like when comparing old
versions of a document with newer versions of a document or similar.
In particular it would have been useful when preparing this mail:
https://lists.debian.org/msgid-search/197a4671e7694c24424b91b4d7288867c0c85d9b.camel@debian.org