Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab: Search Commits per user

Tags:

git

gitlab

As an admin, I would like to find out how many commits are done per branch, per user, total commits by a user in last 3 months, total commits in last 3 months. etc.. How can I do this ?

I could see this on Github like this: List commit by user

I want to see the same thing for GitLab also.

I am running Gitlab CE version: 7.2.1

I thought of running git log --author='userid' but this will take forever to run for so many user / so many branches. Same would apply for running Gitstats because I have to sync all the branches locally first.

Any pointers please?

like image 893
Raghuveer Avatar asked Jul 15 '15 00:07

Raghuveer


People also ask

How to search for user in GitLab?

You can search through your projects from the top bar, by selecting Menu > Projects. On the field Filter by name, type the project or group name you want to find, and GitLab filters them for you as you type.

How do you check all commits in GitLab?

Under the activity tab , there should be a subtab just for 'commits' that lists all commits to the project as they are happening. Or under the repository tab, and commits subtab, users should be able to choose 'all' under the branch drop down. Drag your designs here or click to upload.

How to search content in GitLab?

Select respective group and project from the dropdown. Enter the text to be searched and click on 'Search' button.


1 Answers

Gitstats is good to get html reports. It internally runs the git commands that you can easily change in its source to get your own kind of report.

On another note, I don't think git log should take long. You can try this sample and confirm how long it takes

git log --date=short --branches --since=3.months.ago --author=xyz

Running without using --author will give all the commits pushed in last three months.

A list of authors can be used in a single command , it should be separated by a |

Additionally you can use --pretty option to print information in desired format. You can play around with pretty format option as it is rich in offering various formats.

You can also chose this to run on list of specific branches by having them in a iteration loop. Git is very fast in getting this information.

like image 175
Gaurav Tiwari Avatar answered Oct 16 '22 05:10

Gaurav Tiwari