Re: [PATCH] help setting up Visual Diff
From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2003-06-30 01:50:05 CEST
> cmpilato@collab.net wrote..
I agree.
>>Doing this will also allow folks to get the other diff
Actually the default "-u" is not added to the diff command if a (non-empty) "-x" argument is given to svn, so we can already request the other diff types that GNU diff offers. (I consider the "non-empty" restriction to be a bug.)
Robert Spier wrote:
You have removed "-u" and the two "-L label" arguments. I agree that removing "-u" is a good idea if we are to support arbitrary external diff programs; it can easily be passed within "-x" when required. However, the "-L" options cannot so easily be passed by the user, but they are reasonably important in some circumstances. I think we need to devise a better way of invoking an arbitrary diff program.
For example, we could allow the user to specify a diff command with replaceable parameters for FILE1, FILE2, LABEL1 and LABEL2. Examples:
# To use a simple diff program, not using the human-readable labels:
# To recreate the existing default behaviour:
This is not too bad but quoting and word-splitting can get messy. Actually, the same messiness applies to the present "-x" option - e.g. how can you pass an argument with an embedded space?
Here's another idea: we could specify that the external diff program always takes exactly four arguments: the two file names and the two labels. The user can provide a simple shell script or similar wrapper that accepts those four arguments and invokes the desired diff program with an appropriate combination of those arguments and other options. This is flexible (in Unix; maybe not in Windows) but ugly for the simple cases.
Perhaps we need a combination method that allows simple invocation of programs with simple syntax and flexible invokation of other programs.
It would be useful to list the various diff programs that we have access to now, to see what sort of invocation syntax is required for each. This will indicate how much flexibility we need. Here is a start:
diff (GNU diffutils) 2.8.1:
pdiff 0.4 (GNU a2ps 4.13)
zdiff (gzip 1.3)
And of course we should change "GNU diff" to "diff" in the description of "-x" (in subversion/clients/cmdline/main.c).
- Julian
---------------------------------------------------------------------
|
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.