diff options
author | Teddy Wing | 2019-11-03 03:37:55 +0100 |
---|---|---|
committer | Teddy Wing | 2019-11-03 03:37:55 +0100 |
commit | 3507f0c1540871ea815359b16ccf23af79bd8e30 (patch) | |
tree | 82d78ff7ccb42370d4587d2d1643670cecdf38b0 /git-todos | |
download | git-todo-3507f0c1540871ea815359b16ccf23af79bd8e30.tar.bz2 |
Ideas for getting recent TODOs from a range of Git refs
The goal will be to list all TODOs since the branch point. Additionally,
there should be an option to print the TODOs with file names and line
numbers to enable loading the list into Vim's quickfix list.
Diffstat (limited to 'git-todos')
-rwxr-xr-x | git-todos | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/git-todos b/git-todos new file mode 100755 index 0000000..8ab96eb --- /dev/null +++ b/git-todos @@ -0,0 +1,20 @@ +#!/bin/sh + +# Show TODOs since base branch + +git diff --diff-filter=a -S'TODO' "$(git oldest-ancestor)"... | + egrep --after-context 1 '^\+.*\bTODO\b' | + sed 's/^+[[:space:]]*//' + + +# Want: +# - filename +# - line number + +# Use git blame? + +# fgrep -A 1 -n TODO $(git diff --name-only $(git oldest-ancestor)... ) +# ^ not quite the same thing, as it will catch old TODOs in updated files + +# https://stackoverflow.com/questions/23298812/python-unified-diff-with-line-numbers-from-both-files +# diff --unchanged-line-format=' %.2dn %L' --old-line-format="-%.2dn %L" --new-line-format="+%.2dn %L" <(git show @~:app/module/background/nativeMessageManager.js) app/module/background/nativeMessageManager.js |