[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: Sat, 4 Apr 2009 00:40:46 +0400

Greetings, Andrey Repin!

> 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?

Based on this observation, I suggest to not pass -u to internal diff if an -x
specified, and implement config option to explicitly set the default options
for svn diff, being it internal or external diff, with "-u" as default option,
but accepting empty parameter set to disable it.

More correct way of doing this could be change in the way the external diff
program called, to pass only 2 compared files, leaving file descriptions as
optional 3&4 arguments, or tokenize the parameter, as follows:
diff-cmd = C:/bin/diff.exe -b -L "%olddesc" -L "%newdesc" -- %oldfile %newfile

 Andrey Repin (anrdaemon_at_freemail.ru) 04.04.2009, <0:30>
Sorry for my terrible english...
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-04-03 22:46:15 CEST

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