Skip to content

ZIR-000: Add versioned commit-message hooks with branch-based ticket extraction - #362

Open
zeroecco wants to merge 1 commit into
mainfrom
commit-normalize-impl
Open

zeroecco wants to merge 1 commit into
mainfrom
commit-normalize-impl

Conversation

@zeroecco

@zeroecco zeroecco commented Jun 7, 2026

Copy link
Copy Markdown

Summary

  • Moves prepare-commit-msg and commit-msg into a tracked hooks/ directory so they are version-controlled alongside the codebase
  • Enhances prepare-commit-msg to extract the ZIR ticket number from the current branch name (e.g. ZIR-123-my-featureZIR-123:) before falling back to ZIR-000
  • Adds commit-msg with an improved error message hinting developers to name branches with a ZIR-XXX prefix
  • Adds hooks/install.sh to symlink hooks into .git/hooks/ and make them executable

Test plan

  • Run bash hooks/install.sh from the repo root and verify symlinks appear in .git/hooks/
  • On a branch named ZIR-42-test-branch, make a commit without a ZIR prefix and verify the message is auto-prefixed with ZIR-42:
  • On a branch without a ZIR prefix, verify the fallback ZIR-000: is used
  • Verify merge commits are skipped by prepare-commit-msg
  • Verify commit-msg rejects a message that does not match ZIR-XXX: ... and displays the branch-naming hint

Nightshift-Task: commit-normalize
Nightshift-Ref: https://github.com/marcus/nightshift

🤖 Generated with Claude Code

…extraction

Moves prepare-commit-msg and commit-msg into a tracked hooks/ directory so
they are version-controlled alongside the code. The enhanced prepare-commit-msg
now extracts the ZIR ticket number from the current branch name (e.g.
ZIR-123-my-feature -> ZIR-123:) before falling back to ZIR-000. commit-msg
gains a hint pointing developers to name branches with a ZIR-XXX prefix.
install.sh wires the hooks into .git/hooks via symlinks.

Nightshift-Task: commit-normalize
Nightshift-Ref: https://github.com/marcus/nightshift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant