git ls-tree --name-only -z -r HEAD|egrep -z -Z -E '\.(php|py|html)$' |xargs -0 -n1 git blame --line-porcelain|grep "^author "|sort|uniq -c|sort -nr
Its not ussually entirely accurate. e.g if a coder adds an if .. else block to enclose existing code, formatting shifts the whole block right by a tab/space and git attributes the authorship of the whole block to this author. Another example is an coder who uses a lot of external libraries and git assumes he is the author.
Nevertheless, its a nice trick to know.
No comments:
Post a Comment