Configure Diff to Show Whitespace

Back in TFS 2005, if you used the Compare command to compare the contents of two source files, differences in whitespace were ignored by default.  In the case where two files differed only in whitespace, we didn’t even display the diff tool, but showed the following dialog:

image

While we received feedback that many users didn’t like this behavior (differences in whitespace don't mean identical), there are some users that actually do not care about files differing only in whitespace.

To enable the compare tool to ignore whitespace, the /ignorespace option can be used.  Configuring the compare tool to use this option by default involves the following:

  1. Click Tools -> Options.
  2. In the Option dialog, go to Source Control, and find the Visual Studio Team Foundation Server section.
  3. Click on the Configure User Tools button to modify the compare and/or merge tool(s).
  4. On the Configure User Tools dialog, click Add to add a new tool using the following parameters:
    • Extension: .*
    • Operation: Compare
    • Command: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\diffmerge.exe
    • Arguments: %1 %2 %6 %7 %5 /ignorespace

image

James Manning has a great blog post about how to configure many popular third party compare and merge tools.  Check it out for all of the details on the how tools are configured, and what those % options really mean.

Comments

  • Anonymous
    April 20, 2009
    PingBack from http://asp-net-hosting.simplynetdev.com/configure-diff-to-show-whitespace/

  • Anonymous
    April 23, 2009
    As the number of TFS users grows inside MS, rarely does a day go by where I don’t get forwarded a question

  • Anonymous
    April 24, 2009
    This week on Channel 9, Dan and Brian discuss the week's developer news, including: - Silverlight