Thanks for all the feedback, advice and ideas so far :)

IIRC Subversion needs to communicate the following file names to the
user's diff program:

mine, yours, base and output

It then takes the user input (--diff-cmd) from either the command line
or a script, and produces a command to run the external diff in order
to harvest that output.

All we need to do is to render the command line *exactly* as typed
within the delimiters of (say) %% at the end and start, with the
exception that %mine %yours, %base and %output will be string
substituted by subversion accordingly (a bit like printf does)

A simple case:

-diff-cmd=%%/usr/fancy_diff_cmd %mine %yours %base %output%%

or more complex:

-diff-cmd=%%/usr/fancy_diff_cmd -x "" -L ' ' %mine -Q %yours -Z %base -q "xyzzy" %output%%

The reason for the un-unix-like "%" syntax is that we don't want to restrict user's freedom to use any kind of switches or whatever syntax they want to use.

Also, the %% delimiter keeps it visually simple for the user as well
and already matches the token pattern we're looking for, plus it makes the quoting issues go away.

What do you think?

Reply via email to