39

Combining svn diff --ignore-eol-style and --ignore-all-space is not working:

$ svn diff -x -w --ignore-eol-style -r 1143:1177 somefile
svn: invalid option: --ignore-eol-style

And,

$ svn diff -x --ignore-eol-style -x --ignore-all-space -r 1143:1177 somefile

Only executes the last option: ignore-all-space

Anybody dealt with this before?

Robᵩ
  • 163,533
  • 20
  • 239
  • 308

2 Answers2

58

The svn command seems to honour only one -x option. This means, you must/can combine all options into one argument:

    svn diff -x "-w --ignore-eol-style"

I did not test whether this is also true for external diff-tools.

A.H.
  • 63,967
  • 15
  • 92
  • 126
  • 2
    If you get `diff: unrecognized option '--ignore-eol-style'` use the short form instead: `svn diff -x -w` – Lucas May 07 '14 at 22:41
  • 1
    When you also want to suppress any newlines introduced or removed you should use an external diff program and add some options `svn diff --diff-cmd '/usr/bin/diff' -x '-u --ignore-all-space --ignore-blank-lines' path1 path2` (-u gives the unified style as does svn diff) – Giso Stallenberg Jul 31 '15 at 11:51
3

You can use external differencing tool with appropriate options (diff-cmd option in SVN config). Check this. Then you have freedom to set any diff tool and provide arguments to it. You can also use it directly:

svn diff --diff-cmd /usr/bin/diff --extensions "-b" -r 1143:1177 somefile

where -b to ignore white space at line end and consider all other sequences of one or more white space characters to be equivalent,

pmod
  • 10,450
  • 1
  • 37
  • 50