What arguments are passed to SVNs --diff3-cmd?
I am trying to write my own diff3 wrap script for SVN and I am wondering what the different parameters are passed to --diff3-cmd
.
The closest I could find so far:
How to use Beyond Compare 3 as diff3-cmd for svn?
But that doesn't quite explain what all the parameters do.
I also tried to pipe this through:
#!/bin/ksh
echo "$*"
like --diff3-cmd
, and got some output, but I can't seem to make the heads or tails of the arguments it spit out. Are they the standard arguments 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
source to share
Are they standard arguments for some unix diff commands?
Yes, these are options for GNU diff3 . This is described in the book svn .
This is what they actually represent:
-
-E
- add parentheses to diff output. eg<<<<<<< mine
-
-m
- Output the merge file directly -
-L
- Same as--label
Give a name to the files. -
.working
- Label name of the working file. -
-L
- Same as--label
Give a name to the files. -
.merge-left.rXXX
- Tag name, which is the revision number of the old version. -
-L
- Same as--label
Give a name to the files. -
.merge-right.rXXX
- Tag name, which is the revision number of the new version. -
<temp-file-path>
- the path to the file "mine". i.e. a working copy before the update process -
<temp-file-path>
- path to the file 'old'. that is, the older version -
<temp-file-path>
- path to file 'yours'. i.e. a newer version
As you can see, the first 2 don't refer to anything other than GNU diff3, so when writing a bat file to pass parameters to an external tool, use twice SHIFT
so that you have the corresponding parameters in slots 1-9, not 3-11.
This is needed for batch files as they only handle 9 parameters, but not needed for bash / python etc.
source to share