A Python-based implementation of "Your Code as a Crime Scene" by Adam Tornhill.
Clone a repo you are interested in and run:
git log --pretty=format:'[%h] %an %ad %s' --date=short --numstat > repo_evo.log
It is also possible to specify date ranges:
git log --pretty=format:'[%h] %an %ad %s' --date=short --numstat --before=2018-10-01 --after=2018-08-01 > repo_evo.log
From the PyCrimeScene directory:
python main.py <path to generated log file> <path to local copy of git repo> <name for output files>
For example:
python main.py repo_evo.log /Code/Repos/DMSC/forward-epics-to-kafka/ output
This will produce the files output.csv
and output.json
.
Adam Tornhill has a rather nice way of displaying the data using d3; his samples can be downloaded at http://www.adamtornhill.com/code/crimescenetools.htm
If you download that you can replace the data in hibernate/hib_hotspot_proto.json
with the JSON generated by PyCrimeScene.
Then opening hibzoomable.html
will display your data.
There are commit hooks for Black and Flake8.
The commit hooks are handled using pre-commit.
To install the hooks for this project run:
pre-commit install
To test the hooks run:
pre-commit run --all-files
This command can also be used to run the hooks manually.