Skip to content

Instantly share code, notes, and snippets.

@tijn
Last active January 31, 2019 19:18
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tijn/4110812 to your computer and use it in GitHub Desktop.
Save tijn/4110812 to your computer and use it in GitHub Desktop.
Produce a histogram with lines of code per author.
#!/bin/sh
git ls-tree -r HEAD | sed -Ee 's/^.{53}//' | \
while read filename; do file "$filename"; done | \
grep -E ': .*text' | sed -E -e 's/: .*//' | \
while read filename; do git blame --line-porcelain "$filename"; done | \
sed -n 's/^author //p' | \
sort | uniq -c | sort -rn
@iandundas
Copy link

Thanks! Very cool

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