diff/merge configuration in Team Foundation - common Command and Argument values

One of the extensibility points we have in Team Foundation V1 is that you can configure any other diff and merge tools you want. The purpose of this article is to start collecting the most common ones we know or heard about in a central place so people don't have to figure these out on their own. This UI is available via tools -> options -> source control -> visual studio team foundation server -> "configure user tools" button or via the command-line with "tf diff /configure"

For additional background, try to remember that there are 2 operations that both involve "merge", so we on the TFVC team have tried to use 2 different terms to help clarify which operation is being talked about.

First, there is "tree merge", which you do via the Merge Wizard in the UI or via the "tf merge" command from the command-line. This operation brings over changesets (or parts of them) from one branch into another (or, in the case of /discard, communicates that you don't want them brought over). Many times those changes will just "come over" - the target will have the changes pended on them and you'll be free to check them in with no manual intervention needed.

Second is "content merge", the operation where you take changes inside an individual file and merge them together to make a final output. This is typically needed when the changes are such that they won't automatically merge together (2 users both changing the same line of a file, for instance), but that's not a requirement.

With this in mind, try to remember that what you're really configuring here is diff and "content merge" tools - the "tree merge" operations are done by TF, the extensibility here is the tool being used for content merging individual files.

We use the SourceSafe-style syntax for argument passing. We don't cover this on our doc page about configuring these diff tools, but these are what the argument parameters mean. Note that we're already adding double-quotes around the parameters (since most of the time, there's at least one temp file involved, at the path to that typically has spaces in it), so you typically don't need to add your own quoting.

%1 = Original file (in diff, the pre-changes file, in merge, the "server" or "theirs" file, the file that is the base file after "their" changes were applied)

%3 = Base file (in the 3-way merge operation, the file which both "theirs" and "yours" are derived from - the common ancestor. This doesn't mean it's the version the changes were based from, since this may be a cherry-pick merge)

%4 = Merged file (The output file for the merge operation - the filename that the merge tool should write to)

%5 = Diff options (any additional command-line options you want to pass to your diff tool - this comes into play only when using "tf diff /options" from the command-line)

%6 = Original file label (The label for the %1 file)

%7 = Modified file label (The label for the %2 file)

%8 = Base file label (The label for the %3 file)

%9 = Merged file label (The label for the %4 file)

Here are the values we've come up with for various tools. If you have additions/corrections, please email me: jmanning at microsoft.com. I'm keeping these as separate tables since you typically think about configuring either one or the other at a given time.