Instead of manually (un)commenting it all the time, use something like git diff --cached | grep FIXME to search only the staged (to be commited) changes for FIXMEs.
EDIT: Sorry, this will only work as a pre-commit hook, my bad. To make this a pre-push hook, git fetch the remote and run the diff against the remote HEAD.
To make this a pre-push hook, git fetch the remote and run the diff against the remote HEAD.
I think if you do that the alarm will go off if the remote HEAD fixes FIXMEs that still exist in your branch.
Better to diff against last(public() and ancestors(.)); in Git speak I think that would be origin/my_branch_name, which AFAICT you can obtain via origin/$(git rev-parse --abbrev-ref HEAD). Although that breaks if you are in a detached head state. Is there a more idiomatic way to do this?
Instead of manually (un)commenting it all the time, use something like
git diff --cached | grep FIXMEto search only the staged (to be commited) changes for FIXMEs.EDIT: Sorry, this will only work as a pre-commit hook, my bad. To make this a pre-push hook,
git fetchthe remote and run the diff against the remote HEAD.I think if you do that the alarm will go off if the remote HEAD fixes FIXMEs that still exist in your branch.
Better to diff against
last(public() and ancestors(.)); in Git speak I think that would beorigin/my_branch_name, which AFAICT you can obtain viaorigin/$(git rev-parse --abbrev-ref HEAD). Although that breaks if you are in a detached head state. Is there a more idiomatic way to do this?