You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Chris Pepper <pe...@reppep.com> on 2004/10/03 04:38:48 UTC
--diff-cmd arguments
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.
>pepper@g4:~/Sites/cvs/subversion/doc/book/book$ svn diff --diff-cmd
>bbdiff ch0?.xml > pepper-book-20041002.xml.diff
>bbdiff: -u: No such file or directory
>svn: 'bbdiff' returned 255
>
>pepper@g4:~/www/pepper/public_html/svn/subversion/doc/book/book$ svn
>diff --diff-cmd sdiff ch0?.xml
>Index: ch00.xml
>===================================================================
>sdiff: invalid option -- u
>sdiff: Try `sdiff --help' for more information.
>svn: 'sdiff' returned 2
>pepper@g4:~/www/pepper/public_html/svn/subversion/doc/book/book$ svn --version
>svn, version 1.0.8 (r11084)
> compiled Sep 25 2004, 00:19:29
>
>Copyright (C) 2000-2004 CollabNet.
>Subversion is open source software, see http://subversion.tigris.org/
>This product includes software developed by CollabNet
>(http://www.Collab.Net/).
>
>The following repository access (RA) modules are available:
>
>* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
> - handles 'http' schema
> - handles 'https' schema
>* ra_local : Module for accessing a repository on local disk.
> - handles 'file' schema
>* ra_svn : Module for accessing a repository using the svn network protocol.
> - handles 'svn' schema
>
>pepper@g4:~/www/pepper/public_html/svn/subversion/doc/book/book$ uname -a
>Darwin g4.reppep.com 7.5.0 Darwin Kernel Version 7.5.0: Thu Aug 5
>19:26:16 PDT 2004; root:xnu/xnu-517.7.21.obj~3/RELEASE_PPC Power
>Macintosh powerpc
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 OS X (built via fink) or FreeBSD 5.3BETA (built from
ports).
http://svnbook.red-bean.com/svnbook-1.0/ch03s05.html#ftn.id2707073
http://svnbook.red-bean.com/svnbook-1.1/ch03s05.html#ftn.id870677
>pepper@guest:~/public_html/svn/subversion/doc/book/book$ svn diff
>--diff-cmd /usr/bin/sdiff --extensions '' ch00.xml
>Index: ch00.xml
>===================================================================
>sdiff: invalid option -- u
>/usr/bin/sdiff: Try `/usr/bin/sdiff --help' for more information.
>svn: '/usr/bin/sdiff' returned 2
>pepper@guest:~/public_html/svn/subversion/doc/book/book$ svn diff
>--diff-cmd /usr/bin/sdiff --extensions '-w170' ch00.xml
>Index: ch00.xml
>===================================================================
>sdiff: invalid option -- L
>/usr/bin/sdiff: Try `/usr/bin/sdiff --help' for more information.
>svn: '/usr/bin/sdiff' returned 2
>pepper@guest:~/public_html/svn/subversion/doc/book/book$ svn --version
>svn, version 1.0.8 (r11084)
> compiled Sep 28 2004, 23:26:21
>
>Copyright (C) 2000-2004 CollabNet.
>Subversion is open source software, see http://subversion.tigris.org/
>This product includes software developed by CollabNet
>(http://www.Collab.Net/).
>
>The following repository access (RA) modules are available:
>
>* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
> - handles 'http' schema
> - handles 'https' schema
>* ra_local : Module for accessing a repository on local disk.
> - handles 'file' schema
>* ra_svn : Module for accessing a repository using the svn network protocol.
> - handles 'svn' schema
>
>pepper@guest:~/public_html/svn/subversion/doc/book/book$ uname -a
>FreeBSD guest.reppep.com 5.3-BETA5 FreeBSD 5.3-BETA5 #7: Thu Sep 23
>02:49:36 EDT 2004
>root@guest.reppep.com:/usr/obj/usr/src/sys/REPPEP5 i386
Am I smoking crack? Is --extensions broken? It's certainly
under-documented (nothing in svn help, nothing in the manual page,
just 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.
Thanks,
Chris Pepper
--
Chris Pepper: <http://www.reppep.com/~pepper/>
Rockefeller University: <http://www.rockefeller.edu/>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: --diff-cmd arguments
Posted by Julian Foad <ju...@btopenworld.com>.
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
Re: --diff-cmd arguments
Posted by Olaf Dietsche <ol...@olafdietsche.de>.
Chris Pepper <pe...@reppep.com> writes:
> 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.
[...]
> 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 OS X (built via fink) or FreeBSD 5.3BETA (built
> from ports).
With CVS you can give default arguments in .cvsrc, like:
$ cat .cvsrc
diff -u
$
Maybe it's in your environment or in $HOME/.subversion/config?
Regards, Olaf.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org