4

There's another question: howto make diff look like svn diff? but I want the exact opposite. I'm trying to get svn diff to display with < and >

The obvious answer would be:

svn diff --diff-cmd /usr/bin/diff  file

but when I do that I get

/usr/bin/diff: illegal option -- L

So I do this

svn diff --diff-cmd /usr/bin/echo  file

to see what's going on. and it spits out all this, which I can see why diff doesn't like it....

-u -L file (revision 11371) -L file   (working copy) .svn/text-base/file.svn-base file

So... how do I make svn actually use another program for diffing?

2 Answers 2

6

You seem to have a version of diff installed on your system that is too old or incompatible with how svn wants to call it. In my system, the -L option is defined thusly:

   -L label
   --label=label
          Use label instead of the file name in the context format and unified format headers.

So you should just use a diff command that removes that flag before passing it along to your system's diff. I do something similar to add a custom set of options to diff (and add colours), in my .subversion/configs file:

diff-cmd=/home/ether/bin/svndiff-w

...where the program is just a simple shell script:

#!/bin/bash
diff=/usr/bin/colordiff
args="-u -wi -U 6 --new-file"    
exec ${diff} ${args} "$@"

This is discussed in more detail in the manual under Using External Differencing and Merge Tools.

Sign up to request clarification or add additional context in comments.

Comments

0

I get the same error with the --diff-cmd option, this is how I could force correct usage of my /usr/bin/diff:

svn cat $FILE --revision COMMITTED | diff $FILE -

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.