Comparison utility for files and directories: WinMerge

Location: BlogsAll BlogsReviews    
Posted by: mamlin 3/15/2009 4:54 PM

WinMerge is a great open-source utility that's quite a step up if you're still using WinDiff.  WinMerge features easier to read results, inline editing, better desktop integration, regex support and is extendable via plugins.  Oh, and did I mention highlighting of per-character differences within a line?...
 
 
Free versus Paid
First, let me say that my all-time favorite file/directory compare tool is BeyondCompare.  BC is a very mature tool which has seen regular development since 1996.  It is rock-steady and scales well -- I've used it scripted in production environments to keep multiple servers in synch covering more than 60,000 active files.  That said, BC is not free.  Not at all expensive, but still not free.  We'll instead look at a somewhat similar, simpler and open-source tool named WinMerge.
 

WinMerge versus WinDiff -- What's the Diff?
WinDiff is the old standard when it comes to Windows-based file compare tools.  WinDiff is small (137KB), lightweight (no installation needed) and effective in its simple presentation.  It compares both files and directories.  It can be invoked from the command line along with the files/directories to compare (making it an easy go-to compare tool to suppliment other applications).   It can be used to automatically execute an editor (configurable with Notepad as the default) to allow editing either of the compared files.   With these core functions, WinDiff easily takes care of a most basic file compare needs.
 
So what does WinMerge bring to the table (and why would we consider switching)?  First, WinMerge (http://winmerge.org/) matches WinDiff on several key points:  it can be run as a standalone (not-installed) program, compares both files and directories, can be invoked from the comand line and can automatically execute an external editor.  
 
WinMerge, however, goes well beyond WinDiff on a number of features.  First, it boasts an internal editor so you are not required to pop up a new application in a new window to edit a file (though you may still do so if you prefer).  Content can be viewed with selectable Syntax Highlighting with 33 options (ASP, C/C++, CSS, HTML, JAVA, PERL, XML, etc).  Most notably, differences are shown per-line and per-character rather than just per-line as in WinDiff.  This feature alone makes WinMerge a worthy upgrade for many developers.  See the following screenshot which shows both programs comparing the same lines of two similar WEB.CONFIG files:
 

WinDiff versus WinMerge
 
WinDiff (top) and WinMerge (bottom) comparing the same two WEB.CONFIG files.
WinMerge is shown using its Syntax Highlight feature.

 
Display: Integrated versus Side-by-Side

From the screenshot you'll notice that WinMerge displays files side-by-side in split-screen fashion.  I prefer this type of display since I have plenty of room to open up my diff window on my dual-monitor development system.  For those with very limited screenspace, WinDiff's integrated list may be preferable.
 
Highlighting:  Basic versus Enhanced
WinMerge has WinDiff beat hands-down when it comes to highlighting.  First, the Syntax Highlight feature is much easier on the eyes compared to WinDiff's monocolor text plus Syntax Highlighting makes differentiating between code and comments (i.e., critical differents versus non-critical) a breeze.  Going further, though, is WinMerge's per-character diff highlighting.  Note in the previous screenshot line #69.  WinDiff marks the entire line in a highlighted color.  WinMerge goes further by using a secondary highlight to also mark the difference on a character-by-character basis within the line.  In other words, we don't have to manually scan and compare between two similar lines to tell which characters are different.  Nice!
 
Selecting Items to Compare
Here's another area where WinMerge sails past WinDiff.  Both programs provide a dialog box for selecting two files or folders to open and compare.  Both also provide command-line support for doing the same.  WinMerge, however, goes well beyond WinDiff in its command line options by offering features such as recursive folder compare, auto-close if compared files already match, set custom editor window titles (descriptions), set filename filters, prevent either or both compared files from being added to the Most Recently Used file list, enable WinMerge to be closed with a single ESCAPE keypress and a few other options.
 
WinMerge also adds what every modern Windows app should have:  drag-and-drop onto the WinMerge window as well as right-click menu support in Windows Explorer.  I like to select my files from Windows Explorer.  To do so, I highlight two files at once, right-click and select "Compare".  If the files are in different directories, I right-click the first, select "Compare To" and then right-click a second file and select "Compare".  This brings up my comparison in a new WinMerge window.
 
If you are a drag-and-drop person, simply drag files (together or one-at-a-time) onto an open WinMerge window.  The comparisons will open within the existing WinMerge but will be given a new "tab".  That's right -- WinMerge is a tabbed application -- you can have multiple file comparisons open at once within the same program instance.
 
More more more...
WinMerge goes even further by adding support for version control tools (including auto-zipping, unzipping when used with the free 7zip utility), regular expression filtering for both filename and lines within a file, support for plugins (which can be configured to operate based on file extension) and a full 70 (count them: 70) defined shortcut keys/keystrokes.
 
There are more features and options than I've mentioned.  The best resource is the online manul here:
 
   http://winmerge.org/docs/manual/
 
 
WinDiff Trumps in One Notable Feature
Both programs are free and open-source (the WinDiff source code can be found here).  Both do a perfectly fine job of locating differences within files and folders.  Both allow direct (or near-direct) editing of compared files.  Beyond these basics WinMerge excels in almost every respect.....except filesize.
 
WinDiff is small and lightweight:  137KB and does not need to be installed.
 
WinMerge is not-so-small at 3MB.  The 3MB must be installed.  PortableApps offers a version that does not need to be installed but, after adding all the required library files, the standalone version bloats up to 9.9MB.
 
Therefore, if you require very lean apps with little or no footprint then WinDiff, despite its age, is still a top contender.  If, however, you have a few megabytes to spare then WinMerge is a great free option that surpasses the old standard in nearly every respect.

Permalink |  Trackback

Comments (2)   Add Comment
Re: Comparison utility for files and directories: ExamDiff    By Rodney Joyce on 3/16/2009 12:30 PM
Hi Mamlin, whats the difference in a nutshell please? I have always used WinDiff and it's always served my needs (I use Visual SS diff when developing though)

Re: Comparison utility for files and directories: WinMerge    By mamlin on 3/16/2009 12:42 PM
Hi, Rodney- I've updated this post since the body of my original post seems to have dissapeared...also, I've updated my suggested tool to the open-source program WinMerge. The original post talked about ExamDiff (free version) which is still a nice place to start for the first time diff tool user but at that price (free) WinMerge is better. BeyondCompare remains my all-time favorite compare/synch tool and I highly recommend it for those with hard-core comp/synch needs who are willing to spend $50 for the "pro" version. Thanks for reading and commenting!


Your name:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment   Cancel 
You are here:  
 
>> Back to the top of the blog list...

 
        account   advanced   blog   click   cloud   code   content   create   data   different   events   example   feature   file   files   free   function   good   google   just   line   list   module   modules   need   option   page   pages   query   results   role   roles   script   search   select   settings   simple   site   skin   solution   step   tags   terms   time   user   users   value   version   want  
Minimize Google AJAX Search
 
Search ES:  
This is an example of a Google AJAX Search with asynchronous search execution for two searches.  See our blog series, 'Add Google AJAX Search to your DNN skin' for info and sample code.
 
     
Minimize Get the T-Shirt
 
Shirts by Eguana Solutions
(Be cool like us!)
 
     
Minimize Most-Commented Blogs
 
 
     

Minimize Looking for more info?
 

There are tons of helpful
posts from Eguana Solutions 
on the DotNetNuke.com forums.
  
 
Click HERE to see our posts.

 
     
Minimize Modules for Sale
 

Looking for Eguana's modules? 
We're still working on them!
  

Until ours are ready to dazzle and
amaze, you'll have to make do with
the thousands of modules already
available on SnowCovered.

 
     
Minimize Favorite Modules
 

There are many great DNN modules.
A few we highly recommend are:
 
Dynamic Registration
Total control over the user signup process.  Create custom forms, execute your own SQL, use the integrated payment processing features to assign user roles, validate USERNAMEs via AJAX and much more.  Very cool.
 
URL Master
Change to friendly URLs that really ARE friendly.  Add keywords into your page URLs for better SEO.  Create 301 redirects for individual pages.  Force visitors (and search bots) to a single domain (i.e., make everyone use the "www" version of your site's URL or vice versa).  One of the single best upgrades for any DNN site.
 
Document Exchange 5 (DMX5)
Drag-and-drop from Windows Explorer directly into the DMX file manager!  File versioning, file and folder moderation, extend user permissions down to the file level (for user groups and even for individual users).  Infinite file and file info presentation options via custom display templates.  Store files locally or remotely via UNC (i.e., can securely store files somewhere besides your web server).  Much more.
 
XMOD by DNNDev
Rock-solid form module for data collection.  From simple feedback / email forms to complex, multi-part tabbed forms.  XMOD is different from other form modules because XMOD does not create a new database table for every new form definition -- an important feature if you plan to create dozens or hundreds of forms over the life of your DNN instance!  Excellent support from the developer and an active community around this module.
 
If you desire your form module to create a new DB table for each new form definition, a great alternative to XMOD is the Dynamic Forms module from DataSprings.  Dynamic Forms offers direct DB access beyond that found in XMOD as well as an easy drag-and-drop form builder option to help you get up and running very quickly.

 
     

Login