gitstats
gitstats is a simple statistical analysis tool for git repositories written in python. It analyzes the history of the repository and shows general statistics per author. It was purely developed for fun and to create a little friendly competition among team members. Furthermore, it calculates interesting timeline analysis and reports code changes over time for a high level overview over the repository.
Execution
gitstats can be executed running the command gitstats.py
in the repository directory.
$ cd $PROJECT_DIRECTORY
$ $GITSTATS_DIRECTORY/gitstats.py --format markdown > gitstats.md
Example outputs
gitstats is based on templates which you can customize your output
Markdown
CUMULATED COMMITS OVER TIME BY AUTHOR
date | Romolo | Numa Pompilio | Tullo Ostilio | Anco Marzio | Tarquinio Prisco | Servio Tullio | Tarquinio il Superbo |
---|---|---|---|---|---|---|---|
2016-02 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2016-03 | 5 | 5 | 0 | 0 | 0 | 0 | 0 |
2016-04 | 56 | 33 | 0 | 0 | 0 | 0 | 0 |
2016-05 | 112 | 45 | 0 | 0 | 0 | 0 | 0 |
2016-06 | 126 | 70 | 0 | 0 | 0 | 2 | 0 |
2016-07 | 128 | 84 | 19 | 4 | 0 | 2 | 0 |
2016-08 | 133 | 110 | 21 | 20 | 0 | 2 | 0 |
2016-09 | 136 | 117 | 43 | 28 | 0 | 2 | 0 |
2016-10 | 137 | 135 | 94 | 43 | 8 | 2 | 0 |
2016-11 | 137 | 159 | 109 | 56 | 23 | 2 | 0 |
2016-12 | 137 | 177 | 128 | 69 | 49 | 2 | 0 |
2017-01 | 137 | 183 | 145 | 75 | 62 | 2 | 0 |
2017-02 | 137 | 199 | 213 | 86 | 75 | 2 | 0 |
2017-03 | 137 | 216 | 250 | 104 | 95 | 2 | 0 |
2017-04 | 137 | 230 | 295 | 119 | 120 | 2 | 0 |
2017-05 | 137 | 233 | 338 | 130 | 128 | 2 | 12 |
2017-06 | 137 | 233 | 388 | 148 | 153 | 2 | 20 |
2017-07 | 137 | 233 | 400 | 158 | 161 | 2 | 29 |
[...]
COMMITS BY AUTHOR
author | commits | insertions | deletions | % of changes | impact/commit |
---|---|---|---|---|---|
Tullo Ostilio | 400 | 273229 | 239169 | 57 | 1280 |
Numa Pompilio | 233 | 65995 | 27998 | 10 | 403 |
Tarquinio Prisco | 161 | 73754 | 48478 | 13 | 759 |
Anco Marzio | 158 | 83017 | 30135 | 12 | 716 |
Romolo | 137 | 23831 | 14835 | 4 | 282 |
Tarquinio il Superbo | 29 | 4609 | 833 | 0 | 187 |
Servio Tullio | 2 | 28 | 18 | 0 | 23 |
total | 1120 | 524463 | 361466 |
[...]
Confluence wiki
Pages in Confluence can be created with wiki markup. Using this mode gitstats prepares a content using that you can easily insert in the editor:
- Choose Insert > Markup
- Select Confluence wiki
- Paste your text - the preview will show you how it will appear on your page
- Choose Insert
See Confluence Wiki Markup TODO: create a client to directly create the page
Some features
- Cumulated commits over time by author
- Impacts over time
- Commits over time by authors
- Authors not active for over a year
- Commits by Author
- Commits without ticket reference by author
- Commits on behalf of
- Reviews
- Remote origin refs by author
- Files by extension
- Edited lines of code by author
- Most impactful commits
- Other statistics (global and of the month)
Requirements
- Git
- Python 3