Last Updated: February 25, 2016
·
386
· tanema

Get the loc by each filetype in a git repo

I wanted to see how much of each language I had in my repo so had to come up with this, hope it helps!

git ls-files | 
 perl -pe "s/.*\.(.*?)\n/\.\1\n/" | 
 awk '/\..*/' | sort | uniq | 
 xargs -n1 -E '\n' -I % sh -c 'git ls-files "*%" | xargs cat | echo "$(wc -l) %"' | 
 sort -rn

https://gist.github.com/tanema/5658738