Hidden Gems in TFS – Part 1 Annotate

In this series of blog posts I like to highlight some features of TFS/Visual Studio that people seem to overlook. In my day to day job I often see that people don’t know about certain feature that are available in Team Foundation Server, Visual Studio or some of the Powertools.

Some features are available as a Powertool. These can be downloaded from here

In this part…….

Annotation

When you use Team Foundation Server Source Control you certainly know about history. Sometimes you want to see the history of a single file and see how certain pieces of code ended up there. Who did that and when was this done.

In TFS 2010 you get the possibility to annotate your file. Simply right click a file in Solution Explorer or Source Control and choose Annotate.

image

When you click this, the latest version of the file is loaded with annotations on the left side.

image

The blocks on the left show you the changeset number, the author and date. When you click the changeset number, the changeset details open directly.

Have fun !

7 Responses to “Hidden Gems in TFS – Part 1 Annotate”

  1. It seems like the annotations apply to the entire changeset but not to individual source code section changes. Not sure if I am missing something. I think I’ve used other source control systems (Mercurial?) where you could annotate line-by-line.

    Thanks for the post and helpful screenshots!

    • True! Annotations are for a changeset but when you open the file you see which lines were modified in that particular changeset.

      Not the same but perhaps worth looking at If you want to see line by line,. Take a look at the code review feature in vs2012.

  2. Hi!
    I can use the annotate tool and it works just fine, but the code is displayed in black & white only, without the usual helper colors. Do you have any idea about what can be the reason and the solution to this issue?
    Thanks for the post!

    • Never seen that one ! Have you tried to reset your Visual Studio ? Start devenv.exe /resetskippkgs and it will start up “fresh”

      • I tried it, and it’s not working. One of my colleagues has the same problems, while it works just fine for the rest of them. Strange…

  3. What if I enter new lines in my code? Does the annotated data (to the left) move down correspondingly?
    Is this the same if I remove one of my code lines?

    • Hi,

      Yes new lines is a change, so you will see the changeset in which the new lines were added. Removed code will not be shown because you annotate the latest version which does not have these lines..