Before pushing a Git commit, I usually want to see all the TODOs that I added in the code. I tried several approaches, but I still have not found a good way to do this.
eg. with the following command, I can see that all TODOs are added (and removed) in the last commit:
git diff HEAD^ | grep "TODO"
However, in this release, I donβt see which files contained the changes, so I have to guess or search for the corresponding files. With the following command, I see all the files with the change "TODO", but I do not see the real TODO:
git diff HEAD^ --name-only -G "TODO"
So my question is: how can I see the diff line and the name of the file containing the difference? For example, is it possible to git diffprefix each line with a file name? Then the grep'ed lines will provide all the information I need.
source
share