Skip to content

A pre-commit prepare-commit-msg script to check for PRNJ-nnnnn and DEV-nnnn in the branch name, and add to the end of the commit message (or verify that they are there)

Notifications You must be signed in to change notification settings

ProReNata/git-hook-prnj-dev-branch-and-commit-message

Repository files navigation

What is this?

A script to be run by pre-commit, to:

  1. Enforce a branch naming standard that all branches should be named [hotfix-]PRNJ-<number>-DEV-<number>-<description>
  2. Add the PRNJ-<number> and the DEV-<number> to the end of the commit message, or optionally just verify that they are there, based on an environment flag
  3. Allow branches starting with wip[-/] or hack[-/] or poc[-/] to pass without following the naming standard.

FAQ

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

About

A pre-commit prepare-commit-msg script to check for PRNJ-nnnnn and DEV-nnnn in the branch name, and add to the end of the commit message (or verify that they are there)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages