Skip to content

ZIR-388: Add tracked prepare-commit-msg and commit-msg hooks with setup script - #347

Open
zeroecco wants to merge 1 commit into
mainfrom
commit-normalize/add-prepare-hook
Open

zeroecco wants to merge 1 commit into
mainfrom
commit-normalize/add-prepare-hook

Conversation

@zeroecco

Copy link
Copy Markdown

Summary

  • Adds hooks/commit-msg — validates that commit messages follow the ZIR-XXX: Description format; skips Merge and Revert commits automatically.
  • Adds hooks/prepare-commit-msg — auto-prepends ZIR-000: to messages that lack a ZIR- prefix, so contributors are never blocked by a forgotten ticket number; skips merge/squash sources and already-conforming messages.
  • Adds scripts/setup-git-hooks.sh — idempotent installer that copies both hooks into .git/hooks/ with executable permissions; safe to re-run.

Test plan

  • Run scripts/setup-git-hooks.sh and verify hooks land in .git/hooks/ as executable files.
  • Commit with a bare message (e.g. "fix typo") and confirm it is rewritten to "ZIR-000: fix typo" by the prepare hook.
  • Commit with a properly formatted message (e.g. "ZIR-42: do something") and confirm it passes through unchanged.
  • Commit a merge/revert and confirm both hooks skip it without error.
  • Run scripts/setup-git-hooks.sh a second time and confirm it completes without error (idempotency).

🤖 Generated with Claude Code

@zeroecco
zeroecco force-pushed the commit-normalize/add-prepare-hook branch from e40297f to ce1eea8 Compare May 18, 2026 09:06
@zeroecco zeroecco changed the title ZIR-000: Add tracked git hooks and contributor setup script ZIR-388: Add tracked prepare-commit-msg and commit-msg hooks with setup script May 18, 2026
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