Advantages of a 3rd party diff/compare tool

I recently spent nearly an hour trying to figure out why all of my unit tests stopped working in a particular class. It turns out that I had accidentally deleted a single character in one of my strings, but the built in diff tool that comes with Team Foundation Server is very simplistic. Learn how and why you can replace your stock compare tool with something a little more powerful.

Here is a screenshot of what you’ll see in the stock Team Foundation Server compare tool:

Default TFS Compare Tool

See how hard it is to spot the difference? The problem is, ANY change on the entire line causes it to show up as “changed”. That includes whitespace changes. For this reason, I frequently end up with extra full lines that are colored as having been changed, making it harder to see the actual code changes. For the most part, I really don’t care about whitespace changes because they deal with the formatting of the document, and I’m more concerned with functional changes to my code.

The good news is that those smart guys at Microsoft make it easy to integrate a third party compare tool right into their tools. James Manning was even kind enough to include detailed instructions and the exact settings needed for every major compare tool. You can even use them for merging if you like.

Since my background is in Subversion and TortoiseSVN specifically, I pulled out my trusty KDiff3 (SourceForge) compare tool. It’s a common alternative for TortoiseSVN’s own diff tool.

After wiring up KDiff3, here is what I saw when I compared revisions:

KDiff3 Character Difference

Notice how easy it is to see that I changed a single letter (it’s obviously easier when it’s full-size).

There are other good reasons to use a third party compare tool (which vary by tool obviously):

  • Easily compare entire file structures (folder diff)
  • Inline editing
  • Easy to use outside of Visual Studio – often with an explorer context menu

I recommend giving a few of the compare tools a try and see which works best for you. I don’t really see any risk in using a third party compare tool, but there are certainly a lot of advantages that you may not even know you’re missing right now. I suggest also taking a look at WinMerge in addition to KDiff3, since it seems to be fairly popular and feature-rich as well.

12 comments on “Advantages of a 3rd party diff/compare tool
  1. JeroenH says:

    I totally agree. I usually configure winmerge as the diff tool, and kdiff3 as the merge tool.

  2. Punit says:

    thanks for the tip! I am using beyond compare now for both diff and merge.

  3. AndrewP says:

    Using a third party tool totally changed everything! I’ve plugged Beyond Compare into TFS and it’s made merging 100% better. Thanks!

  4. Max Rubinstein says:

    Is it possible to replace the merge tool only for UI merges, but still use built-in TFS merge process for “automatic” (non-ui) merges? I would be hesitant to replace the merge tool for my own convenience, if it can materially affect the automatic merge.

  5. Dean says:

    Why bother using Team foundation at all. By the time you’ve hunted around looking for a diff tool you might as well install TortoiseSVN and save yourself a lot of money

  6. Armel says:

    @Dean: TortoiseDiff is not really a reference of the domain however

    using a tool such as BC, ECMerge or Araxis offer a real advantage, and by the way even TortoiseSVN can integrate those tools.

  7. Vikas says:

    @Max Rubinstein: when you follow the instructions in http://ianfnelson.com/blog/tfs-diff-tools/ to launch custom tools for diff/compare and merge, you can actually specify (look at Extension text box on Configure Tool dialog box) on what extension this custom tool must be triggered.

    For Ex – Instead of specifying ‘*’ extension, which means trigger it for any file extension, you can specify ‘.aspx,.asmx’

    BTW, you can complete disable default merge tool on a team project collection level (in TFS 2010) or TFS level in TFS 2005 / 2008. However, it is going to affect all the projects just like making the above change.

  8. Y8 says:

    merges? I would be hesitant to replace the merge tool for my own convenience, didi Games if it can materially affect the automatic merge.

  9. Flash Games says:

    cool article thanks admin

  10. y3 says:

    Good way to treat gas when its low he..he.. people really does this stuff really we have to change.

  11. friv says:

    Good stuff here. Thanks for reminding me, I’m overdue for a mis-alignment.

    friv

  12. jake 27 says:

    I recommend giving a few of the compare tools a try and see which works best for you. I don’t really see any risk in using a third party compare tool, but there are certainly a lot of advantages that you may not even know you’re missing right now. I suggest also taking a look at WinMerge in addition to KDiff3, since it seems to be fairly popular and feature-rich as well.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>