Skip to content

Instantly share code, notes, and snippets.

@hankpillow
Last active December 15, 2016 14:24
Show Gist options
  • Save hankpillow/b0b5f4d5a3acd2f6718136ed258bfcae to your computer and use it in GitHub Desktop.
Save hankpillow/b0b5f4d5a3acd2f6718136ed258bfcae to your computer and use it in GitHub Desktop.
thisYear="2016"
nextYear="$thisYear"
for month in {1..12};
do
nextMonth=$(expr 1 + $month)
if [ "$month" -eq 12 ];
then
nextYear=$(expr 1 + $thisYear)
nextMonth="1"
fi
range="--after=$thisYear-$month-01 --before=$nextYear-$nextMonth-01"
echo "[$thisYear/$month]"
git shortlog --no-merges -sne $range | awk '{sum+=$1; dev+=1; print $0} END{printf "---\n%s\tcommits\n%s\tcontributors\n",sum,dev}'
done
echo "[GENERAL REPORT $thisYear]"
git shortlog --no-merges --since=1.year -sne | awk '{sum+=$1; dev+=1; print $0} END{printf "---\n%s\tcommits\n%s\tcontributors\n",sum,dev}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment