GitStats - git history statistics generator

About

GitStats is a statistics generator for git (a distributed revision control system) repositories. It examines the repository and produces some interesting statistics from the history of it.

Requirements

  • Python (>= 2.6.0)
  • Git (>= 1.5.2.4)
  • Gnuplot (>= 4.0.0)

    sudo apt-get install gnuplot
    
  • a git repository (bare clone will work as well)

Install by distribution

apt-get install gitstats

Install by source code

$ git clone git://github.com/hoxu/gitstats.git
$ cd gitstats
$ sudo make install
$ gitstats 

Usage: gitstats [options] <gitpath..> <outputpath>

Options:
-c key=value     Override configuration value

Default config values:
{'project_name': '', 'processes': 8, 'max_domains': 10, 'commit_begin': '', 'max_ext_length': 10, 'commit_end': 'HEAD', 'linear_linestats': 1, 'style': 'gitstats.css', 'max_authors': 20, 'authors_top': 5, 'start_date': ''}

Please see the manual page for more details.

Follow the usage, you can type as below

$ gitstats -c commit_begin=202205 ~/git-repo ./output

Final you will see below info output:

...
Generating graphs...
[0.69085] >> gnuplot "/home/ggangliu/gitstats/output/mvpgpu-sim/files_by_date.plot"
[0.13818] >> gnuplot "/home/ggangliu/gitstats/output/mvpgpu-sim/day_of_week.plot"
[0.09828] >> gnuplot "/home/ggangliu/gitstats/output/mvpgpu-sim/lines_of_code.plot"
[0.19437] >> gnuplot "/home/ggangliu/gitstats/output/mvpgpu-sim/commits_by_author.plot"
[0.23268] >> gnuplot "/home/ggangliu/gitstats/output/mvpgpu-sim/lines_of_code_by_author.plot"
[0.12541] >> gnuplot "/home/ggangliu/gitstats/output/mvpgpu-sim/hour_of_day.plot"
[0.13389] >> gnuplot "/home/ggangliu/gitstats/output/mvpgpu-sim/commits_by_year_month.plot"
[0.06397] >> gnuplot "/home/ggangliu/gitstats/output/mvpgpu-sim/domains.plot"
[0.09230] >> gnuplot "/home/ggangliu/gitstats/output/mvpgpu-sim/commits_by_year.plot"
[0.08237] >> gnuplot "/home/ggangliu/gitstats/output/mvpgpu-sim/month_of_year.plot"
Execution time 34.62499 secs, 20.27449 secs (58.55 %) in external commands)
You may now run:

   sensible-browser '/home/ggangliu/gitstats/output/mvpgpu-sim/index.html'

Open the above link in browser, will show:

output

Reference