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

Parameters to 'diff'

From: Michael Maxwell <mmaxwell_at_casl.umd.edu>
Date: Tue, 8 Jul 2008 11:08:33 -0400

A couple days ago, in a thread entitled "diff parameters in config file", I asked about using the ~/.subversion/config file to change some things about the way 'svn diff' works. (Specifically, I wanted to change the '-' and '+' tags to the standard '<' and '>'. I forgot to mention that I wanted to turn OFF the '-u' default parameter, which doesn't appear to be possible unless you use a different 'diff'.)

I received a single suggestion (thanks, David Weintraub!), who suggested using a shell script. Apparently that's the only way to send extra parameters to the 'diff' command by default (as opposed to doing it on the command line each time you invoke it--that, or an alias in your .bashrc). I guess I'm surprised at how primitive svn is in this respect; rcsdiff, for example, allows *all* diff parameters to be used (in addition to some rcs-specific ones):
       ...all options of diff(1) that apply to regular files are accepted,
       with the same meaning as for diff. [from the rcsdiff man page]

I have a suggestion: make it possible to add *any* diff-specific parameters by default in the config file. It appears to me that the easiest way to do this would be to change the 'diff-cmd' variable there to be a "command", rather than an absolute path. This would make it parallel to the 'editor-cmd' variable in that same config file. (Alternatively, a separate variable for diff-parameters could be added, but then 'diff-cmd' and 'editor-cmd' would remain non-parallel, which is just plain confusing.)

It would be good to do the same for the diff3-cmd variable in the config file.

BTW, issue 668 in the 'bug' database originally called for this:
     The ~/.subversion/options conf file will control lots of
     things, among them:
        -- which editor to use (as in, $EDITOR), or none
        -- which options to pass to "diff" in "svn diff"
Note that the last line says *options*, not which 'diff'. This issue got signed off without a discussion of the need to pass options, afaict.

This issue was addressed at
    http://svn.haxx.se/dev/archive-2007-03/1210.shtml
which, afaict, is not actually the SVN bug base. This msg is mentioned in passing in Issue 2044, although issue 2044 does not seem to directly address the config file issue. Issue 1390 also mentions a patch to allow "default diff -x options to be specified in the config file." It is allegedly a duplicate (subset) of 2044, although again it's not clear to me that 2044 really does address the config file issue. (2044 says "enable it [the fix, I guess] in response to a new config file option", but I'm not sure what that means.)

I'm new to this, so I don't know if I should add a note to the 2044 Issue. The gist of such a note would be that resolution of 2044 needs to address the config file problem, as I have outlined above. Is that appropriate?

   Mike Maxwell
   CASL/ U Md

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-07-08 17:08:57 CEST

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.