I'm trying to print the per-line contribution of each author to a Git repository.
For that, I use the following command, adapted from How to count total lines changed by a specific author in a Git repository?
git ls-tree -r -z --name-only HEAD -- */*.c | xargs -0 -n1 git blame \
--line-porcelain HEAD |grep "^author "|sort|uniq -c|sort -nr
However, I get the following error:
fatal: cannot stat path 'HEAD': No such file or directory.
What am I doing wrong?