Trying to configure svn external diff program on mac

I am having problems installing an external diff program for svn on Mac OSX Lion. I have both xxdiff and opendiff installed.

I add these lines to ~ / .subversion / config:

diff-cmd = opendiff diff3-cmd = opendiff 

or

 diff-cmd = /Applications/xxdiff.app/Contents/MacOS/xxdiff diff3-cmd = /Applications/xxdiff.app/Contents/MacOS/xxdiff 

But when I call svn, I get this error:

 svn: /Users/tre11/.subversion/config:49: Option expected 

How to fix this problem?

0
source share
2 answers

There are not many diff utilities, except of course GNU, which will accept the parameters specified by svn (bbdiff is one of the few). You must wrap the call in a shell script. He explained in the subversion docs .

Edit Based on your comment that the text diff is still running by default, I think there is an error in your .subversion / config file. This is consistent with your error message. The most likely cause is a space at the beginning of the diff-cmd . Yes, the subversion parser is fond of spaces at the beginning of a line. I put a space at the beginning of my diff-cmd and got the same "Expected Option" error.

+1
source

Here is an example of the one I use with MacVIM

 #! /usr/bin/env perl use strict; use warnings; use constant DIFF => qw(mvim -d -f); my $parameters = $#ARGV; my $file1 = $ARGV[$parameters - 1]; my $file2 = $ARGV[$parameters]; my $title1 = $ARGV[$parameters - 4]; my $title2 = $ARGV[$parameters - 2]; $ENV{TITLE} = "$title1 - $title2"; system DIFF, '-c', 'let &titlestring=$TITLE', $file1, $file2; 

This is a Perl program (but you have Perl on your Mac, so everything is fine).

Basically, you need to know the various parameter positions passed to your program. A quick test shows the following parameters:

  • -u (Unified Diff)
  • -L (In diff, use the following as the header of the left file)
  • bludgen.pl (revision 63) (name of the left hand)
  • -L (In the diff section, use the following as the header of the right file)
  • bludgen.pl (working copy) (right hand name)
  • .svn/text-base/bludgen.pl.svn-base (Left file)
  • bludgen.pl (right file)

More details here .

0
source

Source: https://habr.com/ru/post/1482274/


All Articles