Skip to content

Instantly share code, notes, and snippets.

@netwjx
Created June 6, 2013 10:03
Show Gist options
  • Save netwjx/5720514 to your computer and use it in GitHub Desktop.
Save netwjx/5720514 to your computer and use it in GitHub Desktop.
统计最近一段时间git版本库中代码提交量
git log '@{1 weeks ago}..HEAD' --shortstat --pretty=format:%an | awk '/.+/ {
if($2 != "file" && $3 != "changed,") {
curr = $1
} else {
files[curr]+=$1
inserts[curr]+=$4
deletes[curr]+=$6
}
}
END {
for(i in inserts){
print i ":", "inserts:", inserts[i], "deletes:", deletes[i], "files:", files[i]
}
}'
张三: inserts: 1225 deletes: 1464 files: 30
李四: inserts: 930 deletes: 687 files: 31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment