Subversion config: What's diff3-has-program-arg for?

366 views Asked by At

Subversion has the option diff3-has-program-arg

### Set diff3-has-program-arg to 'yes' if your 'diff3' program
###   accepts the '--diff-program' option.
diff3-has-program-arg = [ yes | no ]

My diff3 does support the --diff-program option, but I don't see where to configure the program to be called.

  • How do I do this?
  • Why would I do this?
2

There are 2 answers

0
Andy On

diff3-has-program-arg appears to be cruft. The option is referenced in libsvn_subr/io.c, but the code that uses the option is disabled by the SVN_DIFF3_HAS_DIFF_PROGRAM_ARG ifdef.

The configure logic to set that macro was removed in this revision.

From an old mail on the svn dev list, it looks like the original need for HAS_DIFF_PROGRAM_ARG was to support both a version of diff that required the --diff-program option and a version that rejected it, prior to implementation of subversion's internal diff support.

1
Edwin Buck On

--- Edited after some testing was performed ---

The --diff-program=value option basically directs diff3 as to which two file difference checking program to use. diff3 will then take the output from a few runs of the two file difference checking program and interleave them into a three way diff output.

Using diff3 --diff-program=diff a b c effectively tells diff3 to use diff as the two way file difference program. The subversion configuration argument diff3-has-program-arg is a flag to subversion to add the --diff-program=xxx parameter when calling the 3 way diff program. I'll bet there's another option somewhere which allows you to set the two way diffing tool too.

I guess that greybeard wasn't pulling my leg (that time), but it was more fun when he was. Just ask anyone who's coded up a bash shell bomb, they'll agree (after the pain is over).

--- Original post follows ---

From the old diff3 pages (thank you GNU).

--diff-program=program
    Use the compatible comparison program program to compare files instead of diff. 

which activates diff's ability to use an external comparison program (instead of it's internal text matcher). I've never seen it used, but an old greybeard once explained it to me that it was intended for better than text comparison programs, like programs that normalized whitespace between different "C" inputs so the diff wouldn't be thrown out of alignment due to tab / space conversion issues (and the like).

I am curious to know if this is true, or just a fanciful myth told to a person who was quite "green" at the time.