Skip to content

Instantly share code, notes, and snippets.

@pbjorklund
Created February 28, 2012 18:31
Show Gist options
  • Save pbjorklund/1934174 to your computer and use it in GitHub Desktop.
Save pbjorklund/1934174 to your computer and use it in GitHub Desktop.
Sorted git blame on repo
# From http://stackoverflow.com/questions/4589731/git-blame-statistics
# Performs a git blame on the repo and sorts the results
git ls-tree -r HEAD | gsed -re 's/^.{53}//' | \
while read filename; do file "$filename"; done | \
grep -E ': .*text' | gsed -r -e 's/: .*//' | \
while read filename; do git blame "$filename"; done | \
ruby -ne 'puts $1.strip if $_ =~ /^\w{8} \((.*?)\s*\d{4}-\d{2}-\d{2}/' | \
sort | uniq -c | sort -rg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment