After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777231 - Add "Per-Hunk Ignore Whitespace" like xxdiff
Add "Per-Hunk Ignore Whitespace" like xxdiff
Status: RESOLVED OBSOLETE
Product: meld
Classification: Other
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: meld-maint
meld-maint
Depends on:
Blocks:
 
 
Reported: 2017-01-13 18:30 UTC by Scott Langley
Modified: 2017-12-13 19:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Scott Langley 2017-01-13 18:30:17 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.
Comment 1 Kai Willadsen 2017-01-21 22:27:44 UTC
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...
Comment 2 GNOME Infrastructure Team 2017-12-13 19:22:42 UTC
-- 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.