Skip to content

Instantly share code, notes, and snippets.

@apg
Created August 20, 2014 15:10
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 apg/c2d9b8b89eed4e9a92bb to your computer and use it in GitHub Desktop.
Save apg/c2d9b8b89eed4e9a92bb to your computer and use it in GitHub Desktop.
How many lines a day do you write?
# This inflates things pretty horribly since it's looking at
# raw lines (including comments, documentation, etc) rather
# than lines of code metrics that you might get from a tool
# like sloccount, or cloc
AUTHOR=apg
for n in {1..100}; do
PAGER=cat git log --numstat --since="$n days ago" --until="$(expr $n - 1) days ago" --author=$AUTHOR | grep '^[0-9]' | awk 'BEGIN { lines = 0 } { lines += ($1 - $2) } END { print lines }'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment