Skip to content

Instantly share code, notes, and snippets.

@mrnugget
Created February 13, 2015 15:12
Show Gist options
  • Select an option

  • Save mrnugget/e707d308b6de487fcd50 to your computer and use it in GitHub Desktop.

Select an option

Save mrnugget/e707d308b6de487fcd50 to your computer and use it in GitHub Desktop.
The Hall Of Blame - Find out who put the most TODOs in the codebase.
#!/bin/bash
# ag is the_silver_searcher (https://github.com/ggreer/the_silver_searcher)
ag TODO | while read line; do
file=$(echo ${line} | awk -F ':' '{print $1}');
lineno=$(echo ${line} | awk -F ':' '{print $2}');
git blame --line-porcelain "./${file}" -L ${lineno},${lineno} | grep author-mail | cut -d ' ' -f 2;
done | sort | uniq -c
# Example output:
# 30 <[email protected]>
# 20 <[email protected]>
# 7 <[email protected]>
# 3 <[email protected]>
# 3 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment