This directory represents the old and obsolete prototype of GitStractor done in Python. It is useful for anyone curious about git analysis from Python, but has some fundamental performance flaws and known issues.
Once the dotnet version is ready, that will be the preferred version of GitStractor.
This project is a rough prototype at present and may have blatant bugs and performance issues.
Current known bugs:
- Performance is very slow to analyze repositories and ranges from 0.2 to 0.8 seconds per commit
- Moved or renamed files are not accurately tracked in the final results
The current working edition of this project involves a Jupyter Notebook that uses PyDriller to mine git repositories and generate CSV files that can be imported into Tableau for analysis.
- Clone your repository locally using
git cloneor a Git tool such as GitKraken or GitHub Desktop. - Install all requirements needed:
- Pandas
- PyDriller
- Open
GitStractor.ipynb - Set
repository_pathequal to the local file path of your git repository. You do not need to specify.git, just the local folder. For example:repository_path = 'C:\\dev\\GitStractor' - Optionally set the
repository_branchif you only want to analyze the main branch (this is recommended for performance and clarity of results) - Run all cells in
Gather.ipynbthis will generate:Commits.csvcontaining all git commitsFileCommits.csvwhich breaks down commits at a one row per file per commit levelFileSizes.csvcontaining file statistics for all source files in the current version of your projectMergedFileData.csvwhich joins togetherFileCommits.csvandFileSizes.csvto provide file information at a per-file-commit basisFileData.csvwhich joins togetherFileSizes.csvandFileCommits.csvto provide commit aggregate information at a per-file basis
The data should now be ready to import into Tableau, Power BI, or another tool. You can also analyze the data in Python or another programming language
Currently, the data is available for viewing in Tableau if you refresh the data sources. Find the GitStractor.twb file and ensure the data source is properly connected to the local CSV files.