Last active
October 31, 2019 12:42
-
-
Save kohlerm/145dfb5f088bedecc9e5dd4e38d666c3 to your computer and use it in GitHub Desktop.
Git nr of commits per year
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -maxdepth 1 -type d -printf '%f\n' | parallel "git -C {} rev-list --count --since='Jan 1 2017' --before='Jan 1 2018' --all --no-merges;echo {}" >2017.txt | |
find . -maxdepth 1 -type d -printf '%f\n' | parallel "git -C {} rev-list --count --since='Jan 1 2018' --before='Jan 1 2019' --all --no-merges;echo {}" >2018.txt | |
find . -maxdepth 1 -type d -printf '%f\n' | parallel "git -C {} rev-list --count --since='Jan 1 2019' --before='Jan 1 2020' --all --no-merges;echo {}" >2019.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pushd $1 | |
git log --shortstat | grep -E "(Author: )(\b\s*([A-Z]\w+)){2}|fil(e|es) changed" | awk ' | |
{ | |
if($1 ~ /Author/) { | |
author = "\"" $2" "$3 "\"" | |
} else { | |
files[author]+=$1 | |
inserted[author]+=$4 | |
deleted[author]+=$6 | |
} | |
} | |
END { for (key in files) { print "" key " ,", files[key], " ,", inserted[key] - deleted[key] } } | |
' | |
popd >/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment