<p>In Team Foundation Server, I know that you can use the <strong>Annotate</strong> 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.</p>

<p>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?</p>

<p>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 :)</p>

[{'answer_id': 78498, 'author': 'granth', 'author_id': 11210, 'author_profile': 'https://Stackoverflow.com/users/11210', 'pm_score': 5, 'selected': True, 'text': '<p>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.</p>\n\n<p>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.</p>\n\n<p>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.</p>\n\n<p>You could also use the TFS VersionControl object model to write a tool that does exactly what you need.</p>\n'}, {'answer_id': 858420, 'author': 'Mitch Wheat', 'author_id': 16076, 'author_profile': 'https://Stackoverflow.com/users/16076', 'pm_score': 1, 'selected': False, 'text': "<p>If you install the TFS Power tools (at least for VS2005); it's called annotate.</p>\n\n<p>It might be part of VS2008...</p>\n"}, {'answer_id': 4125543, 'author': 'Jeroen Wiert Pluimers', 'author_id': 29290, 'author_profile': 'https://Stackoverflow.com/users/29290', 'pm_score': 1, 'selected': False, 'text': '<p>Annotate is now part of Visual Studio (I think it was introduced in VS 2010).</p>\n\n<p><a href="http://msdn.microsoft.com/en-us/library/bb385979.aspx" rel="nofollow">Docs</a></p>\n'}, {'answer_id': 6185950, 'author': 'e-mre', 'author_id': 351671, 'author_profile': 'https://Stackoverflow.com/users/351671', 'pm_score': 1, 'selected': False, 'text': '<p>You can use TFS Analysis Cube to see generate a code churn report, which I believe is something you would like.</p>\n'}, {'answer_id': 41813450, 'author': 'Quincy', 'author_id': 562861, 'author_profile': 'https://Stackoverflow.com/users/562861', 'pm_score': 0, 'selected': False, 'text': '<p>I\'m writing an answer to an 8 year old question :).  Its not really a full answer, but a suggestion to look into excel reports for TFS.</p>\n\n<p>TFS2013 / 2015 on prem has something has an excel report that can be used to visualize Code Churn.  </p>\n\n<p>In VS open team explorer then select "Documents" then explode "Excel Reports". I believe Code Churn report has something like discussed. The report is made by some default project template so I think tfs2013 on prem just creates it.</p>\n\n<p>Code Churn Excel Report VS2015\n<a href="https://msdn.microsoft.com/en-us/library/dd695782.aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/dd695782.aspx</a></p>\n'}, {'answer_id': 48261049, 'author': 'akjoshi', 'author_id': 45382, 'author_profile': 'https://Stackoverflow.com/users/45382', 'pm_score': 0, 'selected': False, 'text': '<p>I had very similar requirement to get details of particular attribute in a file e.g. who added, when, related work items etc.; Following GitHub project is having implementation to get required details and required minimal changes to work with multiple files or project -</p>\n\n<p><a href="https://github.com/SonarQubeCommunity/sonar-scm-tfvc" rel="nofollow noreferrer">SonarQube SCM TFVC plugin</a> </p>\n\n<p>It requires analysis to be executed from Windows machines with the Team Foundation Server Object Model installed (download for TFS 2013). </p>\n\n<p>This blog post is also having good explaination and sample application - </p>\n\n<p><a href="http://geekswithblogs.net/TarunArora/archive/2011/06/18/tfs-2010-sdk-connecting-to-tfs-2010-programmaticallyndashpart-1.aspx" rel="nofollow noreferrer">TFS SDK: Connecting to TFS 2010 &amp; TFS 2012 Programmatically</a></p>\n'}]
['https://Stackoverflow.com/questions/74526', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8114/']