Skip to content

ZIR-000: Fix commit-msg hook installation#328

Open
zeroecco wants to merge 2 commits intomainfrom
fix-commit-msg-hook-installation
Open

ZIR-000: Fix commit-msg hook installation#328
zeroecco wants to merge 2 commits intomainfrom
fix-commit-msg-hook-installation

Conversation

@zeroecco
Copy link
Copy Markdown

@zeroecco zeroecco commented Apr 4, 2026

Summary

Fixes the critical issue where the commit-msg hook was not tracked in the repository, preventing new contributors from installing it.

This PR supersedes #327 with the following fixes:

Changes

  • Add tracked hook file: Creates scripts/commit-msg containing the commit message validation hook
  • Update installation script: Modified scripts/install-commit-msg-hook.sh to copy the hook from scripts/commit-msg to .git/hooks/commit-msg instead of assuming it already exists
  • Update documentation: Fixed manual installation instructions in CONTRIBUTING.md to reference the correct source location

Problem Solved

Previously, the installation script assumed the commit-msg hook already existed in .git/hooks/, which is not tracked by git. This meant:

  • New contributors cloning the repo would not have the hook
  • The installation script would fail with "Error: commit-msg hook not found"
  • There was no way to install the hook without manually creating it

Now the hook is tracked in scripts/commit-msg and can be installed by any contributor.

Testing

The installation script has been tested and successfully:

  1. Copies the hook from scripts/commit-msg to .git/hooks/commit-msg
  2. Makes it executable
  3. Creates the commit message template
  4. Configures git to use the template

The hook correctly validates commit messages in the ZIR-XXX: Description format.

🤖 Generated with Claude Code

zeroecco and others added 2 commits April 4, 2026 02:05
This commit fixes the critical issue where the commit-msg hook was not
tracked in the repository, preventing new contributors from installing
the hook.

Changes:
- Add scripts/commit-msg as a tracked file containing the hook
- Update installation script to copy from scripts/commit-msg to .git/hooks/
- Update CONTRIBUTING.md manual installation instructions to reference
  the correct source location (scripts/commit-msg)

The hook enforces the ZIR-XXX: Description format for all commit messages.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The scripts/commit-msg file is now tracked as executable (mode 100755)
to eliminate the need for users to manually chmod the file during
installation. Updated CONTRIBUTING.md to remove the chmod step from
manual installation instructions.

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