Textmate: Using Filemerge for SVN diff

by Matt Mecham on July 10, 2009

in Uncategorized

While browsing the interweb for possible reasons why Textmate refuses to display the diff for a single file from two SVN revisions from the subversion bundle, I came across this nifty little tip.

It allows you to use Filemerge for the diff report instead, so you get the nice graphical layout and you can resolve conflicts within Filemerge. Naturally you need Apple’s developer tools installed before proceeding any further. Unsure? Check in your “Macintosh HD” for a folder called “Developer”. If you don’t have it, go grab your OS X install disks and install them.

Alright. Here we go:

Go here and copy the code to your clipboard.

Open terminal and run these commands:
mkdir ~/bin
cd ~/bin
pico fmdiff

Now paste in the contents of your clipboard (apple + V)
Hit Control+X and reply with “y” then enter to save out the file.

Finish with:
chmod 0777 fmdiff

Now launch Textmate, go to “Preferences…” and hit the “Advanced” tab.
Enter a new shell variable with the name of “TM_SVN_DIFF_CMD” and a value of “~/bin/fmdiff”.
Close the box.

Now next time you hit SHIFT + Control + A to bring up the subversion dialogue to choose diff from revisions, Filemerge should load.

Neat.

{ 3 comments… read them below or add one }

1 James August 31, 2010 at 7:41 pm

Awesome. Thanks so much!

2 Morgan January 7, 2011 at 6:25 pm

Helpful. Thanks! One little note — if you don’t want to use pico to edit the file, you can just use textmate, using “mate” in the command line.

mate fmdiff

3 paul March 8, 2012 at 5:50 pm

:( doesn’t seem to be working on the new text mate 2.

Leave a Comment

Connect with Facebook

Previous post:

Next post: