I've been working with TFS for a few months now and would like to get some basic statistics and make them available to our team. In git, i could retrieve statistics on "commit by author" and "commit by date" etc.
I'd like to show similar statistics from TFS (or from TeamCity).
Is this possible?
Git in Visual Studio, Azure DevOps Services, and TFS is standard Git. You can use Visual Studio with third-party Git services, and you can also use third-party Git clients with TFS. To learn more, see Git and Azure Repos.
Git-TF is a set of cross-platform, command line tools that facilitate sharing of changes between TFS and Git. These tools allow a developer to use a local Git repository, and configure it to share changes with a TFS server.
When you have repository open in Visual Studio code, you can execute the command Git: View History (git log) from the command Plate. This will open the Git History Window with all change logs for the repository. You can then select individual commits for detailed change logs for each of them.
The easiest way I find for poking around in TFS statistics is to play with Excel reports - you can pivot on just about anything you can imagine. For a guide to getting started take a look at this blog post I wrote:
http://www.woodwardweb.com/vsts/getting_started.html
TFS provides a full data warehouse over the top of the regular repository data for you to dig into.
You can use the TFS API to create any queries you like. You can quite easily iterate through the changesets looking for all commits by a certain author, or commits in a certain date:
TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri("http://tfsserver:8080/"));
tpc.EnsureAuthenticated();
VersionControlServer vcs = tpc.GetService<VersionControlServer>();
int latest = vcs.GetLatestChangesetId();
DateTime earliestDate = new DateTime(2011, 1, 1);
do
{
var changeset = vcs.GetChangeset(latest);
if (changeset.CreationDate < earliestDate)
{
break;
}
// do analysis of the changeset here,
// e.g. use changeset.Committer or changeset.Changes
} while (latest-- > 0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With