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

diff parameters in config file

From: Michael Maxwell <mmaxwell_at_casl.umd.edu>
Date: Mon, 7 Jul 2008 15:37:21 -0400

I want to make svn diff use the traditional '<' and '>' in place of '-' and '+' for labeling the lines from the repository version and my working version.

One way to do this is of course to specify it on the command line:
    svn diff --diff-cmd /usr/bin/diff -x '-h' foobar
But since I always want to do this, I would rather not specify it on every command line.

I set up an alias in my .bashrc file
   alias svndiff = svn diff --diff-cmd /usr/bin/diff -x '-h'
then later ran across the ~/.sconfig/config file. Only I can't seem to make it work there!

Specifically, if I do
   diff-cmd = /usr/bin/diff -h
in that config file, I get an error msg:
   exec of '/usr/bin/diff -h' failed: No such file or directorysvn: '/usr/bin/diff -h' returned 255
because svn is attempting to interpret the entire "/usr/bin/diff -h" line (space chars included, shades of Windows) as a path, as described in the config file:
   ### Set diff-cmd to the absolute path of your 'diff' program.
(BTW, '-h' is supposed to be a no-op in the version of 'diff' I'm using, but for svn it results in '<' and '>' being output in place of '-' and '+'; without passing *some* parameter to the diff command, this does not work. This also seems to determine whether I get context lines or not. My guess is that if I supply at least one parameter, svn diff doesn't supply any of its own; otherwise it supplies its own. Go figure...)

Oddly, the analogous command works fine for setting the editor:
   editor-cmd = /usr/bin/vim -c ":start"
as also described in the config file:
   ### Set editor to the command used to invoke your text editor.
So 'diff-cmd' is a *path*, and 'editor-cmd' is a *command*.

So, a couple-three questions:
1) Is there a better way to do what I'm trying to do, namely use '<' and '>' in place of '-' and '+'?
2) Is there a way in the config file to pass a parameter to the diff command?
3) Why are the editor and the diff command treated differently in the config file?

This is under svn 1.4.2, RedHat Linux.

   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-07 21:37:42 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.