Bug 312996 - [quick diff] Quick Diff should allow to ignore white-space
Summary: [quick diff] Quick Diff should allow to ignore white-space
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 enhancement with 6 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-14 21:41 EDT by Chris West (Faux) CLA
Modified: 2017-07-26 12:50 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris West (Faux) CLA 2010-05-14 21:41:15 EDT
Build Identifier: I20100506-0800

Normal diff views (compare with -> base revision / git index / local history, and the History diffs, ...) have an option on the right-click menu of "ignore whitespace".


This is generally(?) persisted, so re-opening a compare view (even for a different file) will also ignore the white-space.

Quick diff ignores this setting.  It either shouldn't, or should have it's own ignore whitespace option.


Motivation: 

I believe most people have their "compare with" view set to "ignore whites-pace", as they don't care about white-space changes at all.

Some, like me, even have a save action to clean-up some white-space (remove trailing white-space) that generates loads of "diff noise" with it disabled.

When using the "Quick Diff -> Use this reference source:" of the "pristine" version control copy ("Pristine SVN copy", which seems to work fine for egit too?), this means that any saves between opening the file and the first commit in that file render quick diff useless.

This results in returning to the Compare with -> view, which supports the "ignore white-space" setting.

Reproducible: Always

Steps to Reproduce:
1. Set quick diff to "pristine whatever copy".
2. Check in a file with random white-space.
3. Edit the file locally and change all the white-space, but make no semantic changes to the contents.
4. Observe the overview ruler being full of blue/black/pink sections you aren't interested in.
Comment 1 Matt Whitlock CLA 2011-01-14 00:58:57 EST
It's not only changes in whitespace at ends of lines that make Quick Diff nearly useless.  Adding or removing a control-flow structure around any block of code causes Quick Diff to show all lines in that block as having changed.  This can confuse the diff's ability to find minimal changes in surrounding code and generally creates quite a mess of a diff.

Suggest the following Quick Diff options, which follow from the options available in the GNU diffutils:

[ ] Ignore changes in white space
     ( ) Ignore changes due to tab expansion only (-E)
     ( ) Ignore changes in the amount of white space (-b)
     ( ) Ignore all white space (-w)
[ ] Ignore changes whose lines are all blank (-B)
Comment 2 Matt Whitlock CLA 2011-01-14 04:28:56 EST
(In reply to comment #1)
> [ ] Ignore changes whose lines are all blank (-B)

"Ignore changes whose lines are all blank" maybe only makes sense in the context of diff hunks.  A better way to word the option for Quick Diff might be "Ignore changes in the number of blank lines".
Comment 3 Joshua Goldberg CLA 2017-07-26 12:50:10 EDT
This is important to me both for diff noise from whitespace cleanup and especially for control structure (wrapping in or removing an if block or loop around some code.)

Please do not share the setting with the general editor diff.  I for one use them differently — I use full-on diff for more "heavy" processes where I'm much more likely to want to see the whitespace changes.  I use the sidebar all the time to see where I'm working in a long file, and the noise gets in the way of that.  I think it would often be the case that I would not realize the setting had changed when I go to look at a "slow" diff, and would miss some of that information.  In any case, I would find it a bother to have to change the setting back and forth when I (more rarely) use the full diff.

I think this would be most discoverable as a checkbox in the quickdiff context menu: "Ignore whitespace".  Also fine to make it a dialog for "Ignore whitespace..." with options like Matt Whitlock suggested.  (We could still use a checkmark in the menu to show if any of those whitespace variants are being ignored.)