3 ms·
I'll throw this into the mix git --no-pager grep -I --full-name --line-number 'TODO' |\ sed 's/\(^[^:]*\):\([0-9]\+\):.*/\1\n\2/' |\ xargs -d '\n' -n2
by cerved 5y ago
I'll throw this into the mix
git --no-pager grep -I --full-name --line-number 'TODO' |\
sed 's/\(^[^:]*\):\([0-9]\+\):.*/\1\n\2/' |\
xargs -d '\n' -n2 sh -c 'git --no-pager blame "$0" -L $1,$1'
Not blazing fast but I think it does okay-ish.
What it does:
1) git-grep for files that are checked in, not "binary" that contain the string 'TODO'
2) sed away the actual line contents (git-grep doesn't seem able to only output file:line-nr)
3) use xargs and sh to call git blame on that file:line-nr
This shows the last time the TODO line was modified, ie: it may have been created 10 years ago but somebody modified the last yesterday
edit: one might want to throw in --cached to git-grep to search the index and not just the current working-tree