Page MenuHomePhabricator

Support "Ignore Whitespaces" in Diff
Closed, DuplicatePublic

Assigned To
None
Authored By
aik099
Aug 25 2014, 9:57 AM
Referenced Files
F194609: whitespace.png
Aug 25 2014, 1:13 PM
F194611: whitespace_2.png
Aug 25 2014, 1:13 PM
F194570: DiffWithWhitespacesIgnored.png
Aug 25 2014, 9:57 AM
F194567: Phabricator_DiffPart1.png
Aug 25 2014, 9:57 AM
F194566: Phabricator_DiffPart2.png
Aug 25 2014, 9:57 AM
F194562: Phabricator_FileDiffOptions.png
Aug 25 2014, 9:57 AM
Subscribers

Description

When changing code it maybe required to place and IF around it or change it's scope in any other way. If it happens that with scope developer also changed something in that code, then it's barely visible that way.

I propose to add "Ignore Whitespaces" option to per file "View Options" menu:

Phabricator_FileDiffOptions.png (334×307 px, 27 KB)

which will allow to see changes in current file ignoring all whitespace changes (the simplest case) or ignoring only leading/trailing whitespace changes (harder to do, but has it's uses cases as well).

Currently the GitHub supports secret "?w=1" in diffs to show diff ignoring whitespaces and Atlassian FishEye also has similar options.

Here is how diff looks in Phabricator (honoring whitespaces):

Phabricator_DiffPart1.png (906×1 px, 166 KB)

Phabricator_DiffPart2.png (905×1 px, 135 KB)

And here is how it would look in Araxis Merge (diff tool I'm using to solve this situation currently) with whitespaces ignored:
DiffWithWhitespacesIgnored.png (1×1 px, 380 KB)

Event Timeline

aik099 raised the priority of this task from to Needs Triage.
aik099 updated the task description. (Show Details)
aik099 added projects: Diffusion, Differential.
aik099 added a subscriber: aik099.

We have such an option already, and it is on by default:

whitespace.png (1×1 px, 228 KB)

Here's an example of a diff with whitespace-only changes:

https://secure.phabricator.com/differential/diff/24898/

You can see that they behave like you want them to (I indented the "switch" block):

whitespace_2.png (1×1 px, 177 KB)

Can you upload a diff where this doesn't work to this server?

Maybe there is such option in the Differential, but not in Diffusion, where I'm looking at commit and writing audit on it.