Project

General

Profile

Actions

Patch #1476

open

Ignore whitespace when using SVN (requires installation of gnu diff)

Added by Chris Peterson over 15 years ago. Updated almost 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
-
Start date:
2008-06-16
Due date:
% Done:

0%

Estimated time:

Description

If gnu diff is installed, this will ignore white space differences when doing a difference view between two revisions.


Files

svn_no_whitespace_diff.patch (804 Bytes) svn_no_whitespace_diff.patch Chris Peterson, 2008-06-16 21:27

Related issues

Related to Redmine - Feature #9853: As a code inspector/reviewer, I would like to be able to review the checkins ignoring white-space changesNew

Actions
Related to Redmine - Feature #11414: Ignore whitespace when using GITNew

Actions
Actions #1

Updated by Toshi MARUYAMA about 13 years ago

  • Category set to SCM
Actions #2

Updated by Enrique Garcia almost 13 years ago

Since this patch was released, subversion gained white-spacing ignoring habilities (to be precise, v1.4 onwards support this) so there's a way of doing this without relying on having the diff program installed.

Locate the following line of the diff method inside /lib/redmine/scm/adapters/subversion.rb:

cmd = "#{SVN_BIN} diff -r " 

And replace it with this one:

cmd = "#{SVN_BIN} diff -x '--ignore-all-space --ignore-eol-style' -r " 

The single quotes after -x are intentional. The space after -r is also important.

You can customize the way the spaces are ignored by changing the options passed to -x ; type svn diff help on the console and look under the -x option for more info.

Actions #3

Updated by Charles Sporkman about 11 years ago

Just wanted to throw in my $0.02 and note this is really necessary to make casual diff-ing useful. Just brought in some code that had weird whitespace changes and windows line endings. The redmine diff was totally useless in that instance.

What has to happen to commit this? Do we need a patch to add a "ignore whitespace" toggle in the repo view?

On 2.2.2, this is what the command looks like:

cmd = "#{self.class.sq_bin} diff -x '--ignore-all-space --ignore-eol-style' -r "

Actions #4

Updated by Mathias Fischer almost 10 years ago

+1 but should be optional per repository like in #11414 mentioned

Actions

Also available in: Atom PDF