GNOME Bugzilla – Bug 777231
Add "Per-Hunk Ignore Whitespace" like xxdiff
Last modified: 2017-12-13 19:22:42 UTC
Could you add this feature like xxdiff has? http://furius.ca/xxdiff/doc/xxdiff-secrets.html Per-Hunk Ignore Whitespace Often in a context of looking at many changes, code reviewers get really annoyed with having to review formatting changes intermixed with code changes. Fortunately, some of these changes can be ignored by diff by ignoring the whitespace characters (and this is also supported by xxdiff) but this does not help for the cases when reformatting involves breaking lines. In practice, if you're just re-formatting some code, it is often the case that only whitespace differences are appearing in a diff hunk. For this purpose, xxdiff has a special feature that de-emphasizes diff hunks that only differ in whitespace. perhunk.png The algorithm we use is really simple: given a diff hunk with text on both sides (i.e. a change hunk), we compare all the non-whitespace characters. If the entire hunks do not differ in that way, we de-emphasize the hunk to make it look like both regions are the same (using a gray color similar to the color for non-differing hunks). Those hunks are otherwise still selectable for merging.
This could be done generically with filters (I think) if we fixed the filters-altering-multiple-lines issue. However, it would also be possible to special-case this fix. I'm not against this behaviour, but I'm also not certain it's worth adding a preference for. It's possible that we could repurpose the blank line trimming preference to be a more generic whitespace-ignoring preference...
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/meld/issues/123.