Skip to content

Instantly share code, notes, and snippets.

@filbertkm
Last active August 29, 2015 13:57
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 filbertkm/9838388 to your computer and use it in GitHub Desktop.
Save filbertkm/9838388 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ ! -z $1 ]
then
git blame -M -w $1 | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
else
git ls-files -z | xargs -0n1 git blame -M -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment