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:
guitool = beyondcompare3
tool = 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:
- Open Visual Studio->Tools->Options->Source Control->Visual Studio Team Foundation Server->Configure User Tools.
- Copy the operation’s command, paste it at start of the arguments field and enclose it in double quotes.
- Change the operation’s command to point to ActivateDiff.exe.