Skip to content

Instantly share code, notes, and snippets.

@nikgalushko
Created August 12, 2020 06:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikgalushko/f15a645c438c38c313cfad3618454328 to your computer and use it in GitHub Desktop.
Save nikgalushko/f15a645c438c38c313cfad3618454328 to your computer and use it in GitHub Desktop.
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