Skip to content

Instantly share code, notes, and snippets.

@milcktoast
Last active August 29, 2015 14:25
Show Gist options
  • Save milcktoast/777a8a26c2dda601d151 to your computer and use it in GitHub Desktop.
Save milcktoast/777a8a26c2dda601d151 to your computer and use it in GitHub Desktop.
Author contribution stats (+/-) [with git and awk]
# /bin/sh
IFS=$'\n'
authors=$(git log --format='%aN' | sort -u)
for author in $authors
do
echo $author | awk 'BEGIN { FS = "\" " }; { printf "%-20s ", $1 }'
git log --author="$author" --pretty=tformat: --numstat |
awk '{ add += $1; subs += $2; edits += $1 + $2 } END { printf "%10d (+) %10s (-) %10s (+/-) \n", add, subs, edits }'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment