Created
February 11, 2015 07:46
-
-
Save Imater/0062bae9e0c07b07ade0 to your computer and use it in GitHub Desktop.
git statistic
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
#!bash | |
red='\033[0;32m' | |
nocolor='\033[0m' | |
committers=( eskat0n nad alex dieselT vpestov Imater ) | |
for username in "${committers[@]}" | |
do | |
commits=$(git shortlog -s --author="${username}" --no-merges | awk '/([0-9]+)/ { print $1 }') | |
echo -e "${red}${username}${nocolor}" | |
echo "commits: ${commits}" | |
git log --author="${username}" --pretty=tformat: --numstat \ | |
| gawk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s removed lines: %s total lines: %s\n", add, subs, loc }' - | |
loca=$(git log --author="${username}" --pretty=tformat: --numstat | gawk '{ add += $1 } END { printf "%s", add }' -) | |
avgloca=$(expr ${loca} / ${commits}) | |
echo "avg lines added per commit: ${avgloca}" | |
echo "" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment