Skip to content

Instantly share code, notes, and snippets.

@ksindi
Last active April 23, 2018 22:22
Show Gist options
  • Save ksindi/2dd7fbfc0066aedc5c69b53e1b493da8 to your computer and use it in GitHub Desktop.
Save ksindi/2dd7fbfc0066aedc5c69b53e1b493da8 to your computer and use it in GitHub Desktop.
Top authors by number of lines committed
git ls-tree -rz --name-only HEAD -- . | xargs -0n1 git blame --line-porcelain HEAD -- | grep -aoP "(?<=^author ).*" | sort | uniq -c | sort -rnk1
@ksindi
Copy link
Author

ksindi commented Apr 23, 2018

Hackier version: git ls-tree -r -z --name-only HEAD -- . | xargs -0 -n1 -I % sh -c 'git blame --line-porcelain HEAD -- % |grep -aoP "(?<=^author ).*"|sort|uniq -c;' | awk 'BEGIN{}{a[$2]+=$1}END{ for (i in a) print a[i],i}' | sort -k 1 -n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment