Python script to compare two git branches for basic size reports.
Script runs in the context of the current working directory. Navigate to the directory of a git repository and run the command:
gitcompare BASE_BRANCH FEATURE_BRANCH
There is special logic in the script for the Wolf repo. If you are inside that folder, it will automatically attempt to generate a report for the same branch names in the Shire submodule, then combine the two into a third report.
Comparing dev ← SPIDER-2 (wolf):
Files changed: 253
Additions: 13835
Deletions: 2419
Total changes: 16254
Comparing dev ← SPIDER-2 (shire):
Files changed: 75
Additions: 1600
Deletions: 442
Total changes: 2042
Comparing dev ← SPIDER-2 (Total):
Files changed: 328
Additions: 15435
Deletions: 2861
Total changes: 18296
- Clone the repo:
git clone https://github.com/williamt-ifit/gitcompare.git
- Make the script executable, if necessary:
sudo chmod +x gitcompare/gitcompare
- Create a symlink at some convenient executable location to the absolute path of the script, eg:
(Or, alternatively, just move the script there.)
sudo ln -s /path/to/repo/gitcompare/gitcompare /usr/local/bin/gitcompare