Created
September 14, 2017 06:02
-
-
Save strathmeyer/7e4a80059ce85636cafe64fe99166a34 to your computer and use it in GitHub Desktop.
Blames TODOs in Python files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GIT_GREP="$(git grep -i -n -E '#[ ]*TODO' -- '*.py')" | |
IFS=$'\n' read -rd '' -a LINES <<<"$GIT_GREP" | |
for LINE in "${LINES[@]}" | |
do | |
IFS=: read FILE LINE MATCH <<<"$LINE" | |
echo "$FILE:$LINE" | |
git blame $FILE -L $LINE,+1 | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want to run it in subdirectories, add the
--full-name
option to the GIT_GREP command.