A script to be run by pre-commit, to:
- Enforce a branch naming standard that all branches should be named
[hotfix-]PRNJ-<number>-DEV-<number>-<description>
- Add the
PRNJ-<number>
and theDEV-<number>
to the end of the commit message, or optionally just verify that they are there, based on an environment flag - Allow branches starting with
wip[-/]
orhack[-/]
orpoc[-/]
to pass without following the naming standard.
What if I want to commit code to a branch anyway?
: Then you can SKIP=<hook name>
to tell pre-commit
to skip this check.
Can I get the hook to just verify the commit message, not append IDs automatically?
: Yes, export set an environment flag PRNJ_BRANCH_COMMIT_MSG_AUTO_APPEND=0