Skip to content

Instantly share code, notes, and snippets.

@Mazuh
Created November 21, 2018 22:31
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 Mazuh/05bd1d4bab6e3d6f6fbe86ccb9fa03a7 to your computer and use it in GitHub Desktop.
Save Mazuh/05bd1d4bab6e3d6f6fbe86ccb9fa03a7 to your computer and use it in GitHub Desktop.
Script for reading stats for the git blames of Verto code over the years.
echo "Analyzing..."
for filename in ./*.js; do
total=`git blame $filename | wc -l`
echo "$filename"
for year in 2014 2015 2016 2017 2018; do
yearly=`git blame $filename | grep ".*$year-\d\d-\d\d.*" | wc -l`
percent=`expr 100 \* $yearly / $total`
tonys_yearly=`git blame $filename | grep ".*Anthony Minessale.*$year-\d\d-\d\d.*" | wc -l`
tonys_percent=`expr 100 \* $tonys_yearly / $total`
echo " $year: $yearly (yearly $percent% by everyone and $tonys_percent% by Anthony)"
done
echo " total: $total lines of git blame"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment