Nickolai
Nickolai

Reputation: 1758

Using xxdiff with svn diff command on Unix

I've tried using the command

svn diff --diff-cmd xxdiff some_file.cpp

But it gives me the error message "invalid option -- u"

After some googling, I tried using the "extensions", and setting it to blank, like this:

svn diff --extensions "" --diff-cmd xxdiff some_file.cpp

To get rid of the 'u', which worked, but then xxdiff complained about a "-L" option. How can I get this to work?

Upvotes: 1

Views: 689

Answers (2)

Nickolai
Nickolai

Reputation: 1758

To figure out exactly what was being passed to svn diff, I created a one line script in my local directory called 'svn-xxdiff' which only has one line: "echo $@", and then ran it as follows:

svn diff --diff-cmd ./svn-xxdiff some_file.cpp

This showed me that the arguments being passed to xxdiff were as follows:

-u -L some_file.cpp (revision 1234) -L some_file.cpp (working copy) .svn/text-base/some_file.cpp.svn-base some_file.cpp

Note: "some_file.cpp (revision 1234)" is considered a single argument, I imagine it's because it comes after "-L", please correct me if I'm wrong.

With this information, I created a really quick workaround. In my svn-xxdiff script, I just changed "echo $@" to:

xxdiff --title1 "$3" --title2 "$5" $6 $7 

Pop that file into a $PATH directory (like /bin/) and you should be able to use xxdiff with svn, and the titles will reflect appropriately. I'm not sure how I'd modify this script for a 3-way diff, I have less experience with those, but if others would like to suggest a modification for that, please do.

Upvotes: 1

Le Droid
Le Droid

Reputation: 4774

xx-svn-diff somefile.cpp

Details

Upvotes: 1

Related Questions