https://github.com/linaro/git-stats
https://github.com/linaro/git-stats
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/linaro/git-stats
- Owner: Linaro
- Created: 2021-03-12T07:45:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-31T08:52:44.000Z (over 3 years ago)
- Last Synced: 2025-01-17T21:30:13.809Z (over 1 year ago)
- Language: Python
- Size: 25.4 KB
- Stars: 0
- Watchers: 6
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# git-stats
A simple Python utility to retrieve history of a Git project. Looking
at the project history, it counts the number of commits authored and
signed-off by a group of developers. The group of developers is defined
in one or several 'identity' files. It can be used to retrieve detailed
commit information as well (number of changed lines, date, ...).
# Installation
This script requires Python3. To install all dependencies using pip:
pip install -r requirements.txt
# Usage
$ ./git-stats -h
usage: git-stats [-h] [-v] [-i IDENTITY [IDENTITY ...]] [-g [GROUPS ...]] [-r REFSPEC] [-s [{summary,commits} ...]]
optional arguments:
-h, --help show this help message and exit
-v, --verbose enable verbose output
-i IDENTITY [IDENTITY ...], --identity IDENTITY [IDENTITY ...]
Identity files
-g [GROUPS ...], --groups [GROUPS ...]
restrict developers from these groups
-r REFSPEC, --refspec REFSPEC
refspec to extract commits
-s [{summary,commits} ...], --show [{summary,commits} ...]
List of results/stats to display
# Identity file
The 'identity' file is a Yaml file that contains record for each developer.
A developer data consists of the following:
* Name
* One or several email addresses
* One or several 'groups'. A 'group' can be used to represent an affiliation
for a specific developer. A group includes a date range, if the commit was
done during this date range, then the developer is marked as 'affiliated'
to this group. git-stat can filter commits based on group.
Here is a template identity file:
John Doe:
emails:
- john.doe@linaro.org
- john@doe.com
groups:
- linaro-teamA:
start: 2010-01-01
- linaro-teamB:
start: 2016-01-01
Jane Doe:
emails:
- jane.doe@linaro.org
groups:
- linaro-teamC:
start: 2020-01-01
Note: It is possible to use a Python regular expression in the 'emails' field, using this syntax:
emails:
- //
E.g.
emails:
- /.*@linaro.org/