1

I'm able to get list of Build Definitions in a Project. Then obtained the Builds under each Build Definition and commit details under each Build. Right now I'm only getting 6 fields in Commit details.

Author
CommitId
Committer
Message
Timestamp
Uri

But I don't able to find any api to obtain the changes made in that commit. I want do some string parsing in the commit changes to obtain a value. Is it possible to get commit changes by respective commit using TFS SDK..?

The Coder
  • 2,562
  • 5
  • 33
  • 62

2 Answers2

1

TFS SDK for Java does not provide a full feature to interact with Git repositories. There is a Rest API which can get this information easily but it is only supported from TFS 2015. Since you are using TFS 2013, the alternative way would be use libgit2 to get the detailed information about a commit.

Eddie Chen - MSFT
  • 29,708
  • 2
  • 46
  • 60
0

Assuming you are trying to get the associated changeset summaries from the specified build. Then you are looking for InformationNodeConverters.GetAssociatedChangesets Method (IBuildDetail).

Check this case which should help you:

"

After a lot of fiddling around I finally found the solution. Changeset's have been renamed to Commit's for TFS 2013's git support. Consequently you need to ask for that data when you get build details like this:

var buildDetailSpec = _buildServer.CreateBuildDetailSpec(buildDefinitionUris);
buildDetailSpec.InformationTypes = new[] { "AssociatedCommit" };

Then you perform the query as usual:

var buildQueryResult = _buildServer.QueryBuilds(new [] { buildDetailSpec });
var buildDetail = buildQueryResult[0].Builds;

Then you retrieve the commit, not the changeset, like this:

var commits = buildDetail.Information.GetNodesByType("AssociatedCommit");
var author = commits.First().Fields["Author"];
var comments = commits.First().Fields["Message"];

"

Community
  • 1
  • 1
Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
  • Yes, I've get AssociatedCommit made under a build which might contain one or more commits. I've already obtained the 6 fields under every commit. But it doesn't include changes (maybe called Changeset?) made in a commit (like file add/update/delete performed in that commit). – The Coder Aug 26 '16 at 02:43