Patch #1476
open
Ignore whitespace when using SVN (requires installation of gnu diff)
Added by Chris Peterson over 16 years ago.
Updated over 10 years ago.
Description
If gnu diff is installed, this will ignore white space differences when doing a difference view between two revisions.
Files
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.
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 "
+1 but should be optional per repository like in #11414 mentioned
Also available in: Atom
PDF