git blame -p is going to be easier to parse<p>example:<p><pre><code> git blame --line-porcelain |awk 'BEGIN { ORS=" " } $1=="author" {for (i=2;i<=NF;++i) print $i; printf("\n")}'|sort|uniq -c|sort -n
</code></pre>
better:<p><pre><code> git ls-files -z|xargs -0 -n1 git blame --line-porcelain|awk '$1=="author" {auth=$2; for(i=3;i<=NF;++i) auth=auth " "$i; counts[auth]+=1} END {for(a in counts) print counts[a],a}'</code></pre>