My workflow: I have a master branch and a feature branch. When I'm done with the feature, I merge-squash it into master (then push master to remote, though not immediately, I may work on other features first).
When working on a feature branch I often leave comments like //TODO ...
to remind me to do something. For simplicity, I include them in commits (I'm going to merge squash, so they shouldn't appear in master anyway). But sometimes I forget to clean those comments before finishing up the feature, and so they find their way into master.
I read about "pre-commit hooks", but I don't think that helps me because I don't want to prevent committing those lines in a feature branch. What I want to is to prevent merging into master if the feature branch contains those lines.
Is this possible? (And, is it possible using git alone, without a third-party script / tool?)