Display file diffs in the foreground

A great shortcut for viewing pending changes in Visual Studio is to hold SHIFT and then double-click the file in the Pending Changes window.  Unfortunately most of the time, the resulting diff program’s window (assuming you are using an external diff program) is shown behind the Visual Studio window, requiring you to click it’s icon in the taskbar in order to bring it to the foreground.  This happens about 3 in 4 times, and totally negates the speedup of SHIFT double-clicking. It also happens when using beyond compare with git’s difftool command.

So I have written a small utility to solve this, called ActivateDiff, which you can download from here.

Usage for Git (git difftool command)

Use the following in your global gitconfig file:

[diff]
guitool = beyondcompare3
tool = ad
[difftool "ad"]
path = c:/pathto/activatediff.exe
cmd = \"c:/pathto/activatediff.exe\" \"c:/Program Files (x86)/Beyond Compare 3/bcomp.com\" \"$LOCAL\" \"$REMOTE\"

Usage for Visual Studio:

  1. Open Visual Studio->Tools->Options->Source Control->Visual Studio Team Foundation Server->Configure User Tools.
  2. Copy the operation’s command, paste it at start of the arguments field and enclose it in double quotes.
  3. Change the operation’s command to point to ActivateDiff.exe.
  4. Ok-on-out.

Happy diffing!