Configure SmartGit to use external diff tool DiffMerge

Recently I was configuring a new developer machine and one thing that made me scratch my head was: how to setup an external diff tool in SmartGit (as a bonus point, it’s the same procedure in SmartSVN).

My diff tool of choice is DiffMerge by SourceGear. It is function complete, lightweight and cross-platform tool that does all that I want.

My first attempt was quite straightforward, in SmartGit go to Preferences... -> Tools -> File Compare and Add... a new comparator. The new panel has opened.
File pattern was set to wildcard ‘*‘, then with Choose... button I selected DiffMerge and left Arguments to its default.

SmartSVN file compare settings: first attempt

Now if in SmartGit I double click on a modified file then DiffMerge must be opened, and it’s kinda worked. But not as expected, only file path of files to compare were pre-compiled in “Select files to compare” dialog box, I still need to click Ok to compare them.

In search of perfection

So I’ve started playing with different configurations and came up with these settings that allow a seamless transition between git and diff:
Command: /Applications/DiffMerge.app/Contents/MacOS/DiffMerge
Arguments: -t1=${leftTitle} -t2=${rightTitle} ${leftFile} ${rightFile}

SmartSVN file compare settings: final values

The major difference is that Command must point to actual executable and not to the application container; the other is to specify a title for the left and right panels of DiffMerge so that now they say “Pristine copy…” / “Working copy…” and not some cryptic file path.