I have been using Visual Studio Team System 2008 for a while now and am really starting to like the tightly integrated source control and work item functionality. One thing I cannot get used to is the basic diff/merge tool.

Where is the detail ?

The screenshot below demonstrates the basic nature of the diff tool built into Visual Studio Team System. There is no indication of the number of differences between the files being diff’ed or even the actual differences on a particular line …Visual Studio Team System Default Diff Tool

WinMerge

There is an alternative and it is both open source and free ! From the WinMerge site:

WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.

Download WinMerge and install it.

Configure Visual Studio

Open Source Control > Visual Studio Team Foundation under the Tools > Options menu in Visual Studio.

Tools > Options > Source Control > Visual Studio Team Foundation

Click on Configure User Tools … and the Configure User Tools dialog will become available.

Configure User Tools ...

Add the WinMerge details for the Compare Tool. Click on the Add … button on the Configure User Tools dialog and configure as per the screenshot below. The arrow button next to the arguments text box exposes details about the information that Visual Studio can provide the tool being configured.

Configure Tool for Compare Operation

Add the WinMerge details for the Merge Tool. Click on the Add … button on the Configure User Tools dialog and configure as per the screenshot below. The arrow button next to the arguments text box exposes details about the information that Visual Studio can provide the tool being configured.

Configure Tool for Merge Operation

The Compare and Merge Operations should now be configured to use WinMerge.

Configured User Tools

WinMerge Command Line Options

WinMerge contains a number of command line options. The following are the ones used in the configuration above.

/e Enables WinMerge to be closed with a single Esc key press.
/u Prevents WinMerge from adding either the left or right hand side  file path to the Most Recently Used (MRU) list.
/wl Opens left hand side as read-only.
/wr Opens right hand side as read-only.
/dl Description for left hand side title bar.
/dr Description for right hand side title bar.

Finally a decent diff !

Now a Compare in Visual Studio is more meaningful, It shows the number of differences, their positions within the compared files and actual differences per line. WinMerge supports custom syntax colouring and diff colouring.

Visual Studio Team System with WinMerge

I have been using Visual Studio Team System 2008 for a while now and am really starting to like the tightly integrated source control and work item functionality. One thing I cannot get used to is the basic diff/merge tool.

Quick Guide

This quick guide offers a no frills/get things done approach to replacing the diff/merge tool in Visual Studio Team System with WinMerge. There is a detailed guide for those that want to have a little more detail.

Quick Steps

  1. Download and install WinMerge.
  2. Open the Configure User Tools dialog for Team Foundation based source control in Visual Studio. Tools > Options > Source Control > Visual Studio Team Foundation > Configure User Tools
  3. Add the details for the Compare (diff) Tool by clicking on the Add… button. Extension: .* Operation: Compare Command: C:\Program Files\WinMerge\WinMergeU.exe Arguments: /e /u /wl /wr /dl %6 /dr %7 %1 %2
  4. Add the details for the Merge Tool by clicking on the Add… button. Extension: .* Operation: Merge Command: C:\Program Files\WinMerge\WinMergeU.exe Arguments: /e /u /wl /dl %6 /dr %7 %1 %2 %4

My 4 year old son is beginning to play with and appreciate the LEGO sets that I had as a child. These sets span the years 1978 – 1985 and are still mostly in perfect condition except for one thing: building instructions.

Daddy can you fix this ?

My son was holding a single piece of LEGO but I knew exactly what set it came from and what it had looked like before being dismantled.

Picture from http://www.brickset.com

I searched through the collection of building instructions which had survived numerous moves, fishmoths and the march of time. Then I got that sinking feeling – the building instructions were missing.

Trying to find the relevant pieces in a storage box containing pieces from multiple sets is difficult enough even with the help of building instructions. Without instructions it is almost impossible.

 Storage box full of LEGO

I have the internet …

After calming down to a mild panic in the face of a 4 year old’s tantrum I thought – “LEGO must keep an archive of all their building instructions”. Visiting the Building Instructions section of LEGO’s Customer Service page revealed the following:

We currently have over 3300 building instructions available online which date back to sets packed in 2002.

2002 ? That wasn’t going to help me !

Life savers

Google saved my life and provided me with links to the following sites:

Brickset Allows searching and graphical browsing of sets by set number, year or theme. Has set information from 1961 – 2010. Contains links to Peeron and BrickLink for building instructions and set inventory.
Peeron Has scanned building instructions and set inventory information. Allows simple searching and browsing of sets.
Worldbricks Allows searching and graphical browsing of sets by set number, year or theme. Has set information and scanned building instructions from 1955 – 2009.
BrickLink Has set inventory information. Allows simple searching and browsing of sets.

Happiness restored

Using the Brickset site I visually browsed through their catalogs and found the set information I was after. I used the Peeron site to find the building instructions and the set inventory. Happiness was restored.

Happiness restored