An open API service indexing awesome lists of open source software.

https://github.com/heisantosh/gitstats

Print stats of contributors of a git repository.
https://github.com/heisantosh/gitstats

git golang

Last synced: 5 months ago
JSON representation

Print stats of contributors of a git repository.

Awesome Lists containing this project

README

          

[![Go Report Card](https://goreportcard.com/badge/github.com/heisantosh/gitstats)](https://goreportcard.com/report/github.com/heisantosh/gitstats)

# gitstat
A CLI wrapper around git commands to get contributors stats of a repo for all branches.

## Usage
Supported output formats are table/JSON/CSV. Default output format is table.
Stats can be sorted by commits, additions, deletions.

### Example
Running for a local copy of https://github.com/nshepperd/gpt-2.git.
```bash
$ git remote -v
origin https://github.com/nshepperd/gpt-2.git (fetch)
origin https://github.com/nshepperd/gpt-2.git (push)
$ gitstats -output csv
Contributor,Commits,Additions,Deletions,Files
Neil Shepperd ,40,2092,560,19
Jeff Wu ,25,137298,137136,24
Jeff Wu ,4,478,5,8
Timothy Liu ,3,274,2,2
Ignacio Lopez-Francos ,2,5,5,2
James B. Pollack ,2,2,2,2
Nathan Murthy <1788878+natemurthy@users.noreply.github.com>,2,8,2,1
Neil Shepperd ,2,141,0,3
子兎音 ,2,2,2,2
Anders ,1,26,0,2
Armaan Bhullar ,1,50,1,3
Biranchi <191425+biranchi2018@users.noreply.github.com>,1,3,0,1
Madison May ,1,50,0,3
Mathieu Rene ,1,6,2,2
Max Woolf ,1,1,1,1
Memo Akten ,1,17,9,3
N Shepperd ,1,0,0,0
Santosh Heigrujam ,1,123,0,2
Svilen Todorov ,1,1,0,1
stephan orlowsky ,1,6,0,1
$
$ gitstats -o table
+------------------------------------------------+---------+-----------+-----------+-------+
| CONTRIBUTOR | COMMITS | ADDITIONS | DELETIONS | FILES |
+------------------------------------------------+---------+-----------+-----------+-------+
| Neil Shepperd | 40 | 2092 | 560 | 19 |
| | | | | |
+------------------------------------------------+---------+-----------+-----------+-------+
| Jeff Wu | 25 | 137298 | 137136 | 24 |
| | | | | |
+------------------------------------------------+---------+-----------+-----------+-------+
| Jeff Wu | 4 | 478 | 5 | 8 |
| | | | | |
+------------------------------------------------+---------+-----------+-----------+-------+
| Timothy Liu | 3 | 274 | 2 | 2 |
+------------------------------------------------+---------+-----------+-----------+-------+
| Ignacio Lopez-Francos | 2 | 5 | 5 | 2 |
| | | | | |
+------------------------------------------------+---------+-----------+-----------+-------+
| James B. Pollack | 2 | 2 | 2 | 2 |
| | | | | |
+------------------------------------------------+---------+-----------+-----------+-------+
| Nathan Murthy | 2 | 8 | 2 | 1 |
| <1788878+natemurthy@users.noreply.github.com> | | | | |
+------------------------------------------------+---------+-----------+-----------+-------+
| Neil Shepperd | 2 | 141 | 0 | 3 |
| | | | | |
+------------------------------------------------+---------+-----------+-----------+-------+
| 子兎音 | 2 | 2 | 2 | 2 |
+------------------------------------------------+---------+-----------+-----------+-------+
| Anders | 1 | 26 | 0 | 2 |
| | | | | |
+------------------------------------------------+---------+-----------+-----------+-------+
| Armaan Bhullar | 1 | 50 | 1 | 3 |
| | | | | |
+------------------------------------------------+---------+-----------+-----------+-------+
| Biranchi | 1 | 3 | 0 | 1 |
| <191425+biranchi2018@users.noreply.github.com> | | | | |
+------------------------------------------------+---------+-----------+-----------+-------+
| Madison May | 1 | 50 | 0 | 3 |
| | | | | |
+------------------------------------------------+---------+-----------+-----------+-------+
| Mathieu Rene | 1 | 6 | 2 | 2 |
+------------------------------------------------+---------+-----------+-----------+-------+
| Max Woolf | 1 | 1 | 1 | 1 |
+------------------------------------------------+---------+-----------+-----------+-------+
| Memo Akten | 1 | 17 | 9 | 3 |
| | | | | |
+------------------------------------------------+---------+-----------+-----------+-------+
| N Shepperd | 1 | 0 | 0 | 0 |
| | | | | |
+------------------------------------------------+---------+-----------+-----------+-------+
| Santosh Heigrujam | 1 | 123 | 0 | 2 |
| | | | | |
+------------------------------------------------+---------+-----------+-----------+-------+
| Svilen Todorov | 1 | 1 | 0 | 1 |
| | | | | |
+------------------------------------------------+---------+-----------+-----------+-------+
| stephan orlowsky | 1 | 6 | 0 | 1 |
| | | | | |
+------------------------------------------------+---------+-----------+-----------+-------+
```

To sort by number of commits, then by number of files
```bash
$ gitstats -sort-by=commits,files
```

## Installation

### Using Go
```bash
go get -v -u github.com/heisantosh/gitstats
```