Saturday, May 16, 2009

DevTnT 3 - File Comparer Tools

When digging after some changes in a larger software project in your source control system, comparing files is one thing you'll face yourself doing on a regular basis. But also with other tasks the quick and effective comparison of textual content may be helpful.

So, here we present a non-inclusive list of file comparer tools that we use in the company (a separate post on BeyondCompare will follow.)

Note:

All of these tools can be integrated into Visual Studio as tool for compare and/or merge operations (refer to dodo's post on that topic).

Overview

For an overview see the following image:
(Sorry, I did not manage it to fit the HTML table itself into the current blog layout. )

Microsoft DiffMerge (Visual Studio's default)

Download: None (comes with Microsoft Visual Studio)

Pro
  • It's just there when you use Microsoft Visual Studio
Con
  • Cannot ignore differences in whitespaces (oh man!)
  • No font sizing or other change of the font
  • No highlighting of line differences
  • No user-interface for choosing files
    DiffMerge can only be started from the command line. That is totaly enough for what the tool was made for - as the out-of-the-box tool for comparing text files from within Visual Studio.


WinMerge

Download: http://winmerge.org/

Pro
  • Can get input via clipboard. With WinMerge, you cannot only compare to files from the file system. You even can paste both sides of a comparison session from the clipboard. Very easy.

Con
  • A single hit of the ESC-key leaves the application up and running.
    If you hit the ESC key only one time after you're done with comparing, this just closes the compare panes within WinMerge, but not the application (WinMerge is an MDI-application). Especially when you integrate WinMerge as tool for comparing files in Visual Studio, you probably will end up with several instances of WinMerge, because you just hit the ESC button once.

Perforce P4Merge

Download: http://www.perforce.com/perforce/downloads/component.html

Pro
  • Intuitive presentation (it's cool!)
  • Handy Shortcut Ctrl+1, Ctrl+2 for next/previous difference (left hand only, no wrenching necessary, can keep your right hand on the mouse)
Con
  • No syntax coloring
  • No overview
  • No zooming But you can change the font via the preferences dialog
  • Imperfect mouse/keyboard cooperation
    Clicking somewhere within one of the text blocks to compare does not move the position of the currently selected difference. So, if you scroll down, click somewhere between let's say difference 5 and 6 and then press Ctrl+1 (for "next difference") for the first time you will end up on difference 1, although you maybe would have expected difference 6. That can be very annoying.

PSPad

Download: http://www.pspad.com/de/download.php

Pro
  • Can extract just the different lines

Notepad++ Compare-PlugIn

Download: http://sourceforge.net/project/showfiles.php?group_id=189927&package_id=244011.
For Notepad++ see dodo's post on file editors.

Pro
  • Integrates within my favorite text editor :)
Con
  • Zooming using Ctrl+Scroll does not apply to both sides.
    So, although both windows scroll synchronously, the match in the alignment of the lines on both sides gets out of sync the more you scroll down.
  • Redundant line counter for both files with identical values in all lines wastes horizontal space (but, do you mind that on your super-duper wide screen display?)
  • No highlighting of line differences
  • No possibility to switch back from compare mode to normal mode (or am I missing something?)

KDiff3

Download: http://kdiff3.sourceforge.net/

Pro
  • Can compare/merge up to 3 files
  • Manual alignment for better comparison results

No comments:

Post a Comment