Skip to content

Instantly share code, notes, and snippets.

@song940
Forked from netwjx/output
Last active September 29, 2015 06:05
Show Gist options
  • Save song940/b8b739468a6937c7e8db to your computer and use it in GitHub Desktop.
Save song940/b8b739468a6937c7e8db 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]
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment