Skip to content

Instantly share code, notes, and snippets.

@X140Yu
Last active September 16, 2017 16:36
Show Gist options
  • Save X140Yu/7c5461f846942f605f007cedab1a2dcb to your computer and use it in GitHub Desktop.
Save X140Yu/7c5461f846942f605f007cedab1a2dcb to your computer and use it in GitHub Desktop.
A shell script which helps you calculate a specific person's contribution
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "Usage: $0 Author-Name"
exit 1
fi
echo Total Commit: $(git log --author=$1 --pretty=tformat: --oneline | wc -l)
git log --author=$1 --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "Added lines: %s, Removed lines: %s, Total lines: %s\n", add, subs, loc }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment