Nov
12

Diff & Merge on the Mac - The Best Clients

Merge Sign #2The ability to find differences in source code files and merge conflicts if they arise is a basic task that every programmer requires. Utilities that perform this task are part of every programmers arsenal. So it came as quite a surprise that the selection for such tools on the Mac (a fantastic development platform) was extremely limited.

For my particular purposes, I need a graphical diff/merge tool that's free, works on both the local file system and Subversion, has a way to quickly see how many differences exist and rapidly go to each one. Plus it's going to be running on a Mac, so it needs to have a decent user interface. That's not too much to ask for, is it?

In this post, I'll take a brief look at three free apps, FileMerge, Meld, and Perforce P4Merge. This is not meant to be a comprehensive review, but rather an overview of some of the most popular and capable diff/merge tools available.


FileMerge

Screenshot: FileMergeFilemerge.app, included with XCode, provides basic diff/merge capabilities. As a product from Apple, I would have expected the interface and the representation of changes to be the best-in-class. This however could not be further from the truth. Filemerge is downright painful to look at, and pretty useless. In order to view each change (next/previous), you need to go two menu levels deep in order to get to the command. And if you forget the keyboard shortcut, you have to do it all over again. The number of differences are  located at the bottom of the app. This would be acceptable if I was working with the finder, but I'm working with FileMerge. The most important thing it can tell me is how many changes there are, and it's at the bottom.


Meld

Screenshot: Meld on LinuxMeld is an open source visual diff/merge tool available for Linux and all the Unixes, including Mac OS X. I use Meld daily on Ubuntu and it's solid, provides good merge capabilities, and meets most of my requirements, including being able to quickly go to the next/previous difference in a file. But like FileMerge, the number of differences isn't displayed where I would like it to be. Using Meld on a Mac isn't as Mac-like as other clients. It requires libraries typically only found on Linux/Unix so there's a lot of prerequesites to install first, including X and gnome. Fortunately several articles exist on how to do this, including this one for installing Meld using MacPorts.


Perforce P4Merge

Screenshot: Perforce P4MergePerforce is a highly flexible yet slightly obscure SCM. The concepts of clientspecs are fascinating, especially for inherently limited filesystems like Fat and NTFS, yet I'm still baffled why Workspaces are stored on the server and are user/machine specific. However, included in the free Perforce client (p4v) is a little gem called P4Merge.  Available for Windows, Linux and Mac, P4Merge is one of the best free diff and merge clients I have ever worked with, and best of all, it works completely independently of Perforce. In other words, P4Merge can be used to diff/merge files from virtually any version control system, including git and Subversion. It is also the most usable of the clients, providing a minimal toolbar with quick access to previous/next changes and the number of differences in the files. The merge capabilities are also very impressive.

P4Merge integrates with the Mac quite well, including integration with Cornerstone Subversion client. Using Cornerstone, you can change the diff tool to P4Merge. There is a trick however. Simply specifying P4Merge as the application is not enough. You actually need to perform this task twice, the second time will actually drill into the contents of the app. Specifically, you need to set the app to: /Applications/p4merge/Contents/Resources/launchp4merge. Once this is done, You'll be able to quickly diff files in Cornerstone using one of the best free diff/merge viewers available.


Honorable Mentions

The following tools did not meet my requirements. Most were paid apps, the most expensive of which was Araxis Merge, which is an absolutely fantastic tool by the way.

DiffFiles is a standalone, commercial client included in oXygen XML. I use oXygen XML on the Mac all the time, as it provides the closest thing to XMLSpy on Windows. The bundle also includes a Subversion client, DiffDirs, Tree Editor, and XML Generator, so it's quite a good deal.

Changes by Connect Flow is a commercial, Mac only viewer.

DiffMerge from SourceGear is a free, cross-platform viewer. It appears to have the features a developer would want, but it's ugly as sin.  So quite honestly as a Mac user who is accustomed to a certain level of usability, I would never install this app for that reason alone.
Reblog this post [with Zemanta]



Leave a comment

Facebook LinkedIn last.fm Hulu Twitter RSS
Adopt a Pet

Copyright © 2010 Steve Springett