statgit is a PHP script to generate Git development statistics, similar to the statistics generated by StatSVN.
statgit uses cloc to obtain lines of code, and this needs to be installed.
Note: This is under development, there is lots of data and statistics being collected and more reports will be generated soon.
- Install php and cloc
- Clone statgit
composer installin your statgit directory to generate the
- Clone your target Git repository to a working directory, that statgit will interact with directly
- Execute statgit and wait
php -f statgit/statgit.php ~/openclerk --output ~/openclerk-stats/
statgit will pull the latest Git origin/master to the working directory (in this case,
and then individually check out each commit and execute
cloc to generate file statistics.
After each commit check out has successfully completed, the statgit database is automatically saved
(by default to
<working_dir>/database.json). The statgit process can be cancelled at any time and
resumed later. This also makes it much faster on subsequent startups.
statgit handles force pushes as well; it only considers the commits referenced in the latest
when generating statistics.
Command line options
--last [n]- only parse last n commits
--timezone [s]- use s as the timezone, defaults to "UTC"
To increase PHP's memory limit, use
php -d memory_limit=2400M -f statgit.php [options].
Ideas for future work
- For large code bases: use
--lastto restrict the number of commits.
- For generating specs of just your specs, for example: use
- For removing directories before running any specs: use
--without dir1 --without dir2