Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add git pre-commit hook to catch
nocommit
lines (metabase#22096)
Sometimes you’ll make a change to some code and not want to commit it. You probably add a comment to the code and hope you’ll either see the comment in the diff before committing or just remember not to check in the change. If you’ve ever done this you’ve probably also committed something you didn’t mean to commit. I know I have. Below is a git pre-commit hook that searches for the text `nocommit` and if found rejects the commit. With it you can stick `nocommit` in a comment next to the change you don’t want committed and know that it won’t be committed. You can maintain a list of personal forbidden words by exporting `NOCOMMIT_RE` e.g: `export NOCOMMIT_RE="spy|tap>|curse word"`
- Loading branch information