laurentkempe/GitDiffMargin — pull request #66 by sharwell (2014-09-17 13:33:38+00:00)
Title: Implement Compare to Index, and use IVsDifferenceService

This pull request includes several changes.

1. Create a new editor option that controls the visibility of the diff margin. Future versions of the extension could implement a UI for controlling this value, and it will automatically be functional.

2. Implement three new commands for controlling the base version used in comparison operations. The commands are defined and implemented, but not exposed in the UI.

* **Compare to Index**: The working copy is compared to the index (where files get staged).
* **Compare to Head**: The working copy is compared to the latest commit.
* **Toggle Compare to Index**: A single command which toggles between **Compare to Index** and **Compare to Head**.

3. Avoid creating blobs in the object store for documents that are not dirty. In these cases, additional LibGit2Sharp APIs are available for comparing the working copy on disk to the index and/or head of the repository. The blob creation is only required for comparisons that involve documents that are modified in memory.

4. Use `IVsDifferenceService` when available. This fixes #27 even though no option is created for the command in the UI; since this is a Visual Studio extension it's reasonable to assume the default behavior should feel like Visual Studio (external diffs can always be opened in other ways). Extreme case was taken to not affect Visual Studio 2010 compatibility now or in the future.

1. The `vs11` alias is assigned to the interop referenced assembly from Visual Studio 2012, so it's impossible to accidentally use types introduced by this assembly.
2. The **Embed Interop Types** property is true for just this assembly, so the types are available in Visual Studio 2010.
3. The code handles cases where `IVsDifferenceService` is not available (specifically Visual Studio 2010).