2

I have been trying to write my own diff3 wrap script for SVN and I am wondering what the various parameters that get passed to --diff3-cmd are.

The closest thing I could find so far is:

How can I use Beyond Compare 3 as the diff3-cmd for svn?

But it doesn't quite explain what all of the parameters do.

I also tried to pass it through this:

#!/bin/ksh
echo "$*"

as --diff3-cmd, and got some output, but I cant make heads or tails of the arguments it spit out. Are these the standard args for some unix diff command?

-E -m -L .working -L .merge-left.r1000 -L .merge-right.r1001 /home/user/some/long/filename1 /tmp/tmp /home/user/some/long/filename2
Community
  • 1
  • 1
Mike Miller
  • 2,149
  • 1
  • 18
  • 23

2 Answers2

5

Are these the standard args for some unix diff command?

Yes, these are parameters for GNU diff3. It's covered in the svn book.

This is what they actually represent:

  1. -E - Add brackets to the diff output. e.g. <<<<<<< mine
  2. -m - Output the merge file directly
  3. -L - Same as --label Give a name to the files.
  4. .working - Label name for the working copy file.
  5. -L - Same as --label Give a name to the files.
  6. .merge-left.rXXX - Label name that is the revision number of the older revision.
  7. -L - Same as --label Give a name to the files.
  8. .merge-right.rXXX - Label name that is the revision number of the newer revision.
  9. <temp-file-path> - File path to the 'mine' file. i.e. the working copy before the update process
  10. <temp-file-path> - File path to the 'older' file. i.e. the older revision
  11. <temp-file-path> - File path to the 'yours' file. i.e. the newer revision

As you can see, the first 2 are not relevant to anything other than GNU diff3, so when writing a bat file to pass the parameters to an external tool use SHIFT twice so you have the relevant parameters in slots 1-9 and not 3-11.

This is necessary for batch files as they only handle 9 parameters but is not necessary for bash/python etc.

opticyclic
  • 7,412
  • 12
  • 81
  • 155
Wim Coenen
  • 66,094
  • 13
  • 157
  • 251
1

Have you read the appropriate section in the SVN Book?

Milen A. Radev
  • 60,241
  • 22
  • 105
  • 110