Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
git-stats
for name in $(git log --pretty="%ae%n%cn" | sort | uniq); do
git log \
--author "$name" \
--pretty=tformat: --numstat |
awk -v name="$name" '{
add += $1; subs += $2; loc += $1 - $2
} END {
if (loc != 0)
printf "[%s] Lines: +\033[32m%s\033[0m -\033[31m%s\033[0m; Total: %s\n", name, add, subs, loc
}'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment