Last active
September 16, 2017 16:36
-
-
Save X140Yu/7c5461f846942f605f007cedab1a2dcb to your computer and use it in GitHub Desktop.
A shell script which helps you calculate a specific person's contribution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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