[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Is there a way to unset the built-in -u option to diff command?

From: Andrey Repin <anrdaemon_at_freemail.ru>
Date: Fri, 3 Apr 2009 23:24:27 +0400

Greetings, Paul Koning!

>> I am not sure if you are looking for something similar, but if
>> you pass the following, it shows the unified diff with only the
>> changed line.
>> --diff-cmd diff -x "--unified=0"

> The problem is that you can't get rid of the -u. Essentially, SVN
> assumes that all possible things you might supply as diff-cmd are like
> GNU diff. If you want to call a diff program for which -u isn't a
> valid switch, you're stuck, short of wrapping it in a script to get
> rid of the invalid swich.

> An example is xxdiff.

Moreover, the SVN behavior in this regard inconsistent.
My tests to now:

A. Using internal diff library.
1> svn diff
unified diff

2> svn diff -x -b
unified diff

2> svn diff -x -cb
svn: Error parsing diff options: Bad character specified on command line
(expected, but quite disturbing, as this is most human-readable diff format)

B. Using external diff (script
> echo %* 1>&2
> C:/bin/diff.exe %*
so I can control the passed parameters)
1> svn diff
Parameters passed:
-u -L "file1 (revision 9)" -L "file2 (working copy)" file1 file2
unified diff

2> svn diff -x -b
Parameters passed:
-b -L "file1 (revision 9)" -L "file2 (working copy)" file1 file2
raw diff (lines removed-lines added)

2> svn diff -x -cb
Parameters passed:
-cb -L "file1 (revision 9)" -L "file2 (working copy)" file1 file2
contextual diff (lines changed-lines removed-lines added)

And there's no way to set the external diff parameters in config. Or am I
doing it wrong?

--
WBR,
 Andrey Repin (anrdaemon_at_freemail.ru) 03.04.2009, <23:14>
Sorry for my terrible english...
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1535000
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-04-03 21:26:06 CEST

This is an archived mail posted to the Subversion Users mailing list.