Software developers frequently need to compare source code in two or more versions of a program, or in different programs, when maintaining software or integrating their work with that of others. The Diffuse utility can handle that task better than traditional diff tools, thanks to its versatility and ease of use.
With Diffuse, whose latest version was released last week, users can manually adjust just how lines of text are paired up for comparison. This lets users correct any contextually incorrect line matching and thus guide merge operations, and also makes it possible to focus the comparison on blocks of text that have moved within a file.
Diffuse also lets users edit the files being compared and save changed versions of checked-out working copies. This reduces barriers to experimental development, as users can easily discard portions their work that led to a dead end. Diffuse also has built-in support for several popular open source version control systems.
Most merge tools can perform two-way or three-way merges. Diffuse goes further by supporting n-way merges. It also handles many non-English character encodings, and supports input method editors used to type complex characters commonly used in East Asia.
Canadian developer Derrick Moser began work on Diffuse about four years ago while doing experimental development. For tasks in which lots of editing was necessary he found existing merge tools painful to use. He wrote the first version of Diffuse in C++, the language with which he was most familiar, but after a long break he switched to Python to address several usability issues. “Python has better support for the string and list operations heavily employed in Diffuse. The switch to Python also made Diffuse easier to port to other platforms. I also switched from Qt to PyGTK, as it readily exposed 2-D compositing operations I wished to use for rendering the user interface.”
If you want to try out the software, start at the official web site, where a quick start guide summaries the most commonly used command-line options, and a manual provides additional details, including information on how to use resource files to customise the software’s look and feel. “Several people have used resource files to make Diffuse’s menu accelerator keys match the previous tool they used, make the syntax highlighting colours match their regular editor, and even add syntax highlighting for custom scripting languages,” Moser says.
The first version of Diffuse on SourceForge.net appeared in 2006. Moser says the tool is still relatively unknown, but word is spreading thanks to recommendations from users who like the workflow it affords. Packages for Diffuse are available in repositories for several Linux distributions and other Posix platforms. Moser provide .rpm and .deb packages as a convenience for those who don’t want to wait for the packages to be officially accepted into their Linux distributions.
Moser releases new versions of Diffuse about every two months. Recently he has had help from a few volunteers who have assisted with localisation and improving the project’s web site. He’d welcome more help with localisation, documentation, publicity, and a Mac OS X installer. He’s also thinking about adding directory comparison and synchronisation, and is interested in hearing from anyone who might have novel ways of approaching these tasks. Moser says, “Those who wish to help out can start a discussion on the user mailing list or post feature requests and patches to the project’s issue tracker.”