Skip to content

Instantly share code, notes, and snippets.

@jkoop
Last active May 2, 2023 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkoop/f452c854051d89d80903b921f53f6a36 to your computer and use it in GitHub Desktop.
Save jkoop/f452c854051d89d80903b921f53f6a36 to your computer and use it in GitHub Desktop.
Who gets blamed for the most lines in a git project?
#! /bin/sh
git ls-files -z | \
xargs -0n1 git blame -w | \
grep -o --binary-files=text '^[^(]*([^)]*)' | \
grep -o '([^0-9]*' | \
grep -o '[^(]*' | \
sed 's/\s*$//g' | \
sort -f | \
uniq -c | \
sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment