Wim Van Houts
Wim Van Houts

Reputation: 594

How to get a list of commits of the last week for all repos in Azure Devops

We have several repositories in Azure Devops. In my dashboard, in the project stats I can see that there were X commits by Y authors (for the last 7 days), but, I cannot click on this to get more details. How can I get the list/an overview of who committed what on the repos for the last X days?

Upvotes: 6

Views: 8387

Answers (3)

Wim Van Houts
Wim Van Houts

Reputation: 594

Each of the above is nice, but, is still for one Repo at the time. I wanted to see over all repos in one request. I found the following extension for Azure Devops which allows you to see who did what for different Repose. Works really nice! Pitty such a functionality is not part of the core product.

Upvotes: 8

PatrickLu-MSFT
PatrickLu-MSFT

Reputation: 51083

We do have a build-in feature to achieve your requirement.

Azure DevOps commit history also supports advanced filters that allow you to view various history of the repository, branches, or files with various levels of granularity to support complex scenarios.

enter image description here

Azure DevOps supports advanced commit filters such as :

  • Simple history
  • First parent
  • Full history
  • Full History with simplified merges

But this only apply to a branch of a single Git Repo which is largely restricted.

In our official feature suggestion website, here has exists such feature suggested: How do I view the history of all branches in GIT?.

Note: You can vote and comment there. When has enough votes, the Product Group will consider it as plan.

Though it could not be achieved with UI, here has another work around you can try. You can use Rest API to filter the commit history by author within all branches.

Here is the sample:

GET https://dev.azure.com/{org name}/_apis/git/repositories/{repositoryId}/commits?searchCriteria.author={author name}&api-version=5.1

This API can list the commit records with the author filtered across All branches.

For multiple repos, you need to combine the returned results together.

As another choice, you could also pull the whole repos down and use Git Command to query related info.

Upvotes: 1

Romain Valeri
Romain Valeri

Reputation: 21918

For each given repo, you could ask for this in CLI with

git shortlog --since="7 days ago"

It would output a list sorted by author, like this :

Bob (3):
     Commit message foo
     Commit message bar
     Commit message baz

Alice (1):
     Commit message abc

Of course, this is only the default format, but you could as well use --format=<format> to specify how each commit should be displayed (See Formatting options here).

Upvotes: 3

Related Questions