Skip to content

Instantly share code, notes, and snippets.

@brentsowers1
Created July 31, 2013 02:08
Show Gist options
  • Save brentsowers1/6118765 to your computer and use it in GitHub Desktop.
Save brentsowers1/6118765 to your computer and use it in GitHub Desktop.
Script to show lines attributed to each author
# Get all current files in your repo of the extensions that you want to be considered code
# (.scala and .js for my example)
git ls-files | egrep "\.(scala|js)$" > files.txt
# Now edit files.txt to remove files that you don't want counted, like jQuery extensions
cat files.txt | xargs -n1 git blame -w | ruby -n -e '$_ =~ /^.*\((.*?)\s[\d]{4}/; puts $1.strip' | sort -f | uniq -c | sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment