Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS annotate/blame summary report for a project

In Team Foundation Server, I know that you can use the Annotate feature to see who last edited each line in a particular file (equivalent to "Blame" in CVS). What I'd like to do is akin to running Annotate on every file in a project, and get a summary report of all the developers who have edited a file in the project, and how many lines of code they currently "own" in that project.

Aside from systematically running Annotate of each file, I can't see a way to do this. Any ideas that would make this process faster?

PS - I'm doing to this to see how much of a consultant's code still remains in a particular (rather large) project, not to keep tabs on my developers, in case you're worried about my motivation :)

like image 433
SqlRyan Avatar asked Sep 16 '08 16:09

SqlRyan


People also ask

How to annotate code in Visual Studio?

open your Javascript project or javascript file with Visual Studio Code. CMD + SHIFT + P will open the Command Palette (you can also open via the menu View > Command Palette ) search for ANNOTATION and choose the action you want to perform.

What is annotate in TFS?

Sometimes people want to know who made changes to a file or who has written some specific lines of code. So Instead of searching and tracking we can directly use the Annotation feature in TFS. You can annotate a file to determine who made changes and what changes they made in all the earlier versions of the file.

How to see annotations in Visual Studio?

On the menu bar, choose View, Other Windows, Source Control Explorer. In Source Control Explorer, go to the version of the file you want to annotate, open its shortcut menu, and then choose Annotate. The Annotated window displays the annotated file.


1 Answers

It's easy enough to use the "tf.exe history" command recursively across a directory of files in TFS. This will tell you who changed what files.

However what you're after is a little bit more than this - you want to know if the latest versions of any files have lines written by a particular user.

The Team Foundation Power Tools ship with a command-line version of annotate called "tfpt.exe annotate". This has a /noprompt option to direct the output to the console, but it only outputs the changeset id - not the user name.

You could also use the TFS VersionControl object model to write a tool that does exactly what you need.

like image 119
Grant Holliday Avatar answered Oct 21 '22 10:10

Grant Holliday