Skip to content

Instantly share code, notes, and snippets.

@siddarth
Last active December 13, 2015 17:48
Show Gist options
  • Save siddarth/4950749 to your computer and use it in GitHub Desktop.
Save siddarth/4950749 to your computer and use it in GitHub Desktop.
# H/T: http://stackoverflow.com/questions/6240808/count-line-changes-with-git
git log --stat --author $(git config --get user.email) --since="$(ruby -e "print Time.now - 24*60*60")" --until="now" | awk -F',' '/files? changed/ {
files += $1
insertions += $2
deletions += $3
}
END {
print "Files Changed: " files
print "Insertions: " insertions
print "Deletions: " deletions
print "Lines changed: " insertions + deletions
}' | mail -s "Productivity metrics for $(ruby -e 'print Time.now.to_s')" $(git config --get user.email)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment