C#的VSTS Rest API-如何在获取提交列表时返回完整注释



下面的API方法返回所有commitIds的提交详细信息,但注释被截断,是否有方法获得每个提交的完整注释,而不必为每个提交单独调用API?

GetCommitsAsync(repositoryId, new GitQueryCommitsCriteria() { Ids = commitIds });

根据我的测试,我们无法使用GetCommitsAsync方法获得完整的注释,没有参数来扩展注释长度,尤其是对于多行注释(换行(。

当使用RESTneneneba API(GetCommits(检索提交时,您可以看到"commentTruncated": true,

因此,即使使用REST API,我们也无法获得完整的注释。这里已经提交了一个用户声音来建议该功能,但还没有计划。

但是,我们可以使用git log命令来获得所有提交的完整注释:

git log --first-parent > export.csv 

您也可以格式化它以显示每行提交:

git log --first-parent --format="%h;%ci;%cn;%s;%N" > export.csv

您也可以引用此线程:https://social.msdn.microsoft.com/Forums/en-US/587cedd4-ed32-421a-9aaf-4040c77ce1f5/tfs-git-api-commits-maxcommentlength-limited-to-100-chars-in-the-comments-today?forum=tfsgeneral

最新更新