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

Re: Using an external diff program with Subversion

From: Oliver Dain <odain_at_ll.mit.edu>
Date: 2003-08-12 17:19:53 CEST

>
>
>I don't see what the win is for replaceable parameters if you're going
>to have to use a wrapper script anyway.
>
>In my personal use case...
>
> most of the time I will use SVN's internal diff, or an external
> GNU diff.
>
> when doing comparisons, I might use xxdiff
>
> and maybe pdiff to print things.
>
>simplifying that, I've got GNU diff and xxdiff, which take very
>different argument flags.
>
>How would that work in the config file?
>
>diff-cmd[gnu] = ...
>diff-cmd[xxdiff] = ...
>
>?
>
>That's the real catch for replaceable parameters -- because you don't
>want to specify them on the command line. (Although a wrapper script
>on the outside... would fix that.)
>
>-R
>
>
I imagine a single diff-cmd line in the config file. In your case it
sounds like a wrapper is necessary so your config would look like:

diff-cmd = your/wrapper/pgm %f1 %f2 etc.

and then you'd use your wrapper like you are now. That's not any harder
than what you're doing now. In fact you might decide not to write a
wrapper and invoke svn diff like

svn diff --diff-cmd "/your/diff/pgm %f1 %f2"

allowing you to invoke all your favorite differs right from the command
line without a wrapper.

However, people like me who use a single diff program for all their diff
needs (I suspect these are the majority) would not have to write a
wrapper script and would have a diff-cmd like:

diff-cmd = /my/favorite/diff %f1 %f2

And we'd be done. If we later decided that for some strange reason we'd
like to use a different diff program for a single comparison (e.g. send
both files to emacs to edit instead of diffing) we wouldn't have to
write a wrapper or change the config file but could instead simply use
the --diff-cmd switch for this one exceptional case.

Thus the advantages are:

1) Its easier for users who want to invoke a single diff program
most/all of the time
2) Its not any harder for people currently using a wrapper
3) It allows you to invoke a funky diff program from the command line
without needing a wrapper or having to change your config file and also
makes the -x switch obsolete since you can pass all flags in any order
to your program right from the --diff-cmd switch.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Aug 12 17:38:59 2003

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

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