Last active
December 30, 2015 06:39
-
-
Save fkztw/7791195 to your computer and use it in GitHub Desktop.
from: http://lueewy.com/?p=37 fixed version, still ugly. [usage] sh ./git_commmit_line_count.sh [$author_name]
This file contains hidden or 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 | |
insert=0 | |
delete=0 | |
git log --author=$1 --shortstat --pretty=format:""|sed /^$/d > .tmp.count | |
while read line | |
do | |
current=`echo $line|awk -F ',' '{printf $2}'|awk '{printf $1}'` | |
if [ -z "$current" ]; then | |
current=0; | |
fi | |
insert=`expr $insert + $current` | |
current=`echo $line|awk -F ',' '{printf $3}'|awk '{printf $1}'` | |
if [ -z "$current" ]; then | |
current=0; | |
fi | |
delete=`expr $delete + $current` | |
done < .tmp.count | |
echo $1 $insert insertions, $delete deletions | |
rm .tmp.count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment