On Sat, 2004-10-09 at 14:31, kfogel@collab.net wrote:
> Ross Boylan <ross@biostat.ucsf.edu> writes:
> > I discovered that specifying the -x (for extended args to diff) alone is
> > not adequate; one must specify --diff-cmd as well. Couldn't it default
> > to diff? Or have I missed something?
>
> I wonder about the wisdom of defaulting to whatever 'diff' command
> happens to be available, instead of relying on the user to specify it.
>
I'd say that if someone specifies a diff option, they should expect
their default diff--except that which diff is being called is apparently
non-obvious to Windows users, judging from the list traffic.
On the other hand, the present approach just forces the user to say
--diff-cmd diff
which still has the same ambiguity.
So, on balance, I think it might be useful to default to -diff-cmd
diff. Alternately, the help text needs to be changed.
> But, the behavior right now is inconsistent. If you run
>
> $ svn diff -r11217:11218 -x -u
>
> it shows a unified diff (!). But if you do, say...
>
> $ svn diff -r11217:11218 -x -B
> $ svn diff -r11217:11218 -x -w
> $ svn diff -r11217:11218 -x -c
>
> ...it errors, claiming:
[snip elaboration of preceding point]
A further way this could get very weird is if someone thinks -x -u is
going to their external diff program, and that program behaves
differently from svn's internal logic. Admittedly this is a fairly
unlikely case, but, in time, all errors are possible :)
> > Further, svn help diff says
> > -x [--extensions] arg : pass ARG as bundled options to GNU diff
> > which implies you get GNU diff automatically. I believe that should
> > read "pass ARG as option to the command specified in --diff-cmd", at
> > least at the moment.
> >
> > Using subversion 1.0.6-2 on Debian GNU/Linux.
>
> In r11213 Julian Foad changed it to just "diff", which while it
> doesn't go as far as you suggest, does solve the worst of the problem.
> (Although the new usage message becomes problematic if we use -x for
> something other than diff... which we already do, namely, diff3.)
>
> In sum, this question is rather complex. I think a new option help
> string might be appropriate, one that indicates that -x is not just
> for diff. (Care to try a patch?)
Well, the wording above,
-x [--extensions] arg : pass ARG as option to the command specified
in --diff-cmd
is one possibility.
This is a tough one to do well, as a completely correct statement is
much too verbose to be useful (e.g., in general --diff-cmd specifies an
arbitrary command; svn passes certain arguments to it; and some of those
arguments in certain positions are the ones given to -x).
The manual/book can be a bit more expansive. However, I've noticed that
the reference material in the svn book often says very little about
options, other than documenting their existence. Personally, I'd
appreciate it if the docs covered the options more fully in the
reference section. I realize that would take work...
I think the first thing is to decide the desired behavior. There seem
to be at least two issues:
1) should --diff-cmd have an implicit default argument of 'diff'?
2) should -x -u continue to magically work with the internal diff? (I
assume that if --diff-cmd is specified explicitly, -u is passed to it).
>
> -Karl
--
Ross Boylan wk: (415) 502-4031
530 Parnassus Avenue (Library) rm 115-4 ross@biostat.ucsf.edu
Dept of Epidemiology and Biostatistics fax: (415) 476-9856
University of California, San Francisco
San Francisco, CA 94143-0840 hm: (415) 550-1062
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Oct 12 21:24:05 2004