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

Re: --diff-cmd arguments

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2004-10-03 14:01:32 CEST

Chris Pepper wrote:
> The svn command doesn't used the supplied diff-cmd as provided, but
> appends " -u". This may be convenient for users who want unified diffs
> from the normal /usr/bin/diff, but is inappropriate when using something
> else, such as BBEdit's bbdiff command or sdiff, both of which choke on
> the unsupported -u argument.

Yes, it's an ugly state of affairs, isn't it?

The work-around for the time being is to write a wrapper script that accepts the arguments as supplied (including '-u' and '-L label1' and '-L label2') and ignores some of them and calls the desired diff program. The arguments passed to the wrapper are, in this order:

+ one or more options (see below);
+ "-L"
+ a label for the first or left-hand file, e.g. "project_issues.html (revision 11209)"
+ "-L"
+ a label for the second or right-hand file, e.g. "project_issues.html (working copy)"
+ the first file name, e.g. ".svn/text-base/project_issues.html.svn-base"
+ the second file name, e.g. ".svn/tmp/project_issues.html.tmp"

The initial options are the options specified in "--extensions" if that is non-blank, otherwise "-u".

(That may be a bug. I thought the rule ought to be: the options specified in "--extensions" if that is specified, otherwise "-u".)

Of course this ought to be documented somewhere, but is seems not to be.

> I was unsuccessful at finding the -u option in the svn source, but
> did find mentions in the 1.0 & 1.1 online documentation of an
> --extensions option, which doesn't appear to do anything in 1.0.8 on Mac
>> pepper@guest:~/public_html/svn/subversion/doc/book/book$ svn diff
>> --diff-cmd /usr/bin/sdiff --extensions '' ch00.xml
>> sdiff: invalid option -- u

I thought that used to work (used to prevent '-u' from being passed, though still passing two '-L label' options).

> Am I smoking crack? Is --extensions broken? It's certainly
> under-documented (nothing in svn help, nothing in the manual page, just

Well, maybe a little bit broken. More like "we know it's not very good but haven't invented a better way of doing it". Note that "--extensions" is listed under "svn help diff" with a very short description. It also appears in the list of options for "svn diff" in the book, and is described in the "svn Switches" section of the book, but not described fully (the stuff about wrapper scripts and "-u" and "-L" isn't mentioned).

> a footnote in the book). I will try to address the doc aspect a bit,
> once I understand what's going on, but the source probably needs more
> comments near appearances of "diff-cmd" too.

Yes, a description of the current state of affairs is really needed. Your help with that would be very welcome.

- Julian

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Oct 3 14:08:40 2004

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.