Monday, November 12, 2012

Using TkDiff with Subversion on OSX

Step 1: Download and install TkDiff

Download this from SourceForge, unpack the disk image, and drag the tkdiff application to your Applications directory.

Step 2: Set up an alias to run TkDiff from the command line

In bash on my machine, I added the following to my PATH in my ~/.bash_profile so I could run it via the command line.

Step 3: Tell Subversion to use TkDiff instead of the default

You'll need an adapter script so Subversion can call TkDiff correctly.
# Configure your favorite diff program here.
# Subversion provides the paths we need as the sixth and seventh
# parameters.
# Call the diff command (change the following line to make sense for
# your merge program).
Then add the following to ~/.subversion/config to default to this diff method.
diff-cmd = /Users/tgnourse/scripts/

Step 4: Success!

Now you can diff all your edits like so:
svn diff
In addition, TkDiff has built in subversion support so you can also diff single files like so:
tkdiff your/file.ext