Skip to content

Instantly share code, notes, and snippets.

@saurabhnanda
Created April 9, 2013 11:40
Show Gist options
  • Save saurabhnanda/5345025 to your computer and use it in GitHub Desktop.
Save saurabhnanda/5345025 to your computer and use it in GitHub Desktop.
Count the number of lines with the words TODO or HACK in each commit in a git repository.
#!/bin/bash
# The output of the following command was piped into the STDIN of this script:
# git log --before="2012-07-07" --format="format:%H %ai" > sha1
while read sha1 dt tm tz; do
git checkout -q $sha1;
cnt=`egrep -ri 'todo|hack' app lib|wc -l|tr -d ' '`
echo "$dt $tm,$cnt"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment