Patch #1476
openIgnore whitespace when using SVN (requires installation of gnu diff)
0%
Description
If gnu diff is installed, this will ignore white space differences when doing a difference view between two revisions.
Files
Related issues
Updated by Enrique Garcia over 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.
Updated by Charles Sporkman almost 12 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 "
Updated by Mathias Fischer over 10 years ago
+1 but should be optional per repository like in #11414 mentioned