visual-studio TFS 注释/归咎于一个项目的总结报告

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/74526/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 16:30:01  来源:igfitidea点击:

TFS annotate/blame summary report for a project

visual-studiotfstfs-code-review

提问by SqlRyan

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

在 Team Foundation Server 中,我知道您可以使用Annotate功能查看谁最后编辑了特定文件中的每一行(相当于 CVS 中的“Blame”)。我想做的是类似于对项目中的每个文件运行 Annotate,并获得所有在项目中编辑过文件的开发人员的摘要报告,以及他们目前“拥有”多少行代码项目。

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?

除了系统地运行每个文件的 Annotate 之外,我看不出有什么方法可以做到这一点。有什么想法可以使这个过程更快吗?

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

PS - 我这样做是为了看看有多少顾问的代码仍然保留在一个特定的(相当大的)项目中,而不是密切关注我的开发人员,以防你担心我的动机:)

回答by Grant Holliday

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.

在 TFS 中的文件目录中递归使用“tf.exe history”命令很容易。这将告诉您谁更改了哪些文件。

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.

Team Foundation Power Tools 附带一个命令行版本的注释,称为“tfpt.exe annotate”。这有一个 /noprompt 选项将输出定向到控制台,但它只输出变更集 ID - 而不是用户名。

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

您还可以使用 TFS VersionControl 对象模型来编写一个完全满足您需求的工具。

回答by Mitch Wheat

If you install the TFS Power tools (at least for VS2005); it's called annotate.

如果你安装了 TFS Power tools(至少对于 VS2005);它被称为注释。

It might be part of VS2008...

它可能是 VS2008 的一部分...

回答by Jeroen Wiert Pluimers

Annotate is now part of Visual Studio (I think it was introduced in VS 2010).

Annotate 现在是 Visual Studio 的一部分(我认为它是在 VS 2010 中引入的)。

Docs

文档

回答by e-mre

You can use TFS Analysis Cube to see generate a code churn report, which I believe is something you would like.

您可以使用 TFS 分析立方体来查看生成代码流失报告,我相信这是您想要的。

回答by Quincy

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.

我正在写一个 8 岁问题的答案:)。它不是一个真正的完整答案,而是一个研究 TFS excel 报告的建议。

TFS2013 / 2015 on prem has something has an excel report that can be used to visualize Code Churn.

TFS2013 / 2015 on Prem 有一个 excel 报告,可用于可视化代码流失。

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.

在 VS 打开团队资源管理器中,然后选择“文档”,然后展开“Excel 报告”。我相信 Code Churn 报告有一些类似的讨论。该报告是由一些默认项目模板制作的,所以我认为 tfs2013 on prem 只是创建了它。

Code Churn Excel Report VS2015 https://msdn.microsoft.com/en-us/library/dd695782.aspx

代码流失 Excel 报告 VS2015 https://msdn.microsoft.com/en-us/library/dd695782.aspx

回答by akjoshi

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 -

我有非常相似的要求来获取文件中特定属性的详细信息,例如谁添加、何时添加、相关工作项等;以下 GitHub 项目正在实施以获取所需的详细信息,并且需要最少的更改来处理多个文件或项目 -

SonarQube SCM TFVC plugin

SonarQube SCM TFVC 插件

It requires analysis to be executed from Windows machines with the Team Foundation Server Object Model installed (download for TFS 2013).

它需要在安装了 Team Foundation Server 对象模型的 Windows 计算机上执行分析(下载 TFS 2013)。

This blog post is also having good explaination and sample application -

这篇博文也有很好的解释和示例应用程序 -

TFS SDK: Connecting to TFS 2010 & TFS 2012 Programmatically

TFS SDK:以编程方式连接到 TFS 2010 和 TFS 2012