Repository navigation
fix(guardrails): let git-generated Merge and Revert subjects pass the commit-msg hook #7966
Description
This was generated by AI during attend-queue.
Refs: #5948
Agent Brief
Type: Bug
Summary: The guardrails commit-msg convention hook accepts the subjects git itself writes for merges and reverts.
Current behavior:
The hook exempts only subjects starting fixup! , squash! or amend! . git merge runs the commit-msg hook (https://git-scm.com/docs/githooks), so under the bundled Conventional Commits pattern a non-fast-forward merge (Merge branch 'x') or a git revert (Revert "feat: y") is rejected. The hook's tests have no merge or revert case.
Desired behavior:
A subject starting Merge or Revert " exits 0 before the pattern check, the same way the autosquash forms do. Every other subject is still checked against the team pattern, and a violating one still exits 1 with the existing fix text. The hook's header comment lists the new exemptions. The failure text never suggests skipping the hook.
Key interfaces:
- commit-msg convention hook: its set of exempt subject prefixes grows from the three autosquash forms to five.
- The hook's test suite: gains merge, revert and still-violating cases.
Acceptance criteria:
- The PR's CI runs test-bash and it passes.
- The commit-msg convention hook's test file has a case where subject
Merge branch 'x'exits 0 under the bundled Conventional Commits pattern. - That test file has a case where subject
Revert "feat: y"exits 0 under the same pattern. - That test file has a case where a non-conforming subject such as
update stuffstill exits 1. - A guardrails fragment exists (
scripts/new-changelog-fragment.sh guardrails patch), andscripts/check-changelog-fragments.sh --checkpasses.
Lane notes:
- Known: the end-to-end installer cases in
commit-msg-convention.test.shfail in the lane sandbox with "hook managers conflict" (run 39105934408). They exerciseinstall.mjs, not the exemption. The lane runs only the new cases locally, does not treat the installer failures as its own, and lets the PR's CI test-bash job be the check. - Start from the partial branch
work-resolve-issue/issue-7966-39105934408-1(on origin at73967b2d8d). - No
Hold:body line is required: plugingit-hooks/is not a protected path. The exemption case lives atcommit-msg-convention.sh:86.
Out of scope:
- The hook's
bashshebang and itsbashcall to the resolver (a sibling item). - The shared git-hooks installer and its dispatcher.
- The convention-pattern resolver and its shared copies.
- The config-hook install lane and the user conventions layer.
- The agent-side
block-convention-violationguard.
This was generated by AI during backlog shaping. Split from #5948; the owner approved filing it in an attended backlog-shaping session on 2026-10-18.
Activity
melodic-automation-lanes commentedon Oct 18, 2026
The work-resolve-issue lane stopped partway through this issue and needs a person.
Why, in the run's own words:
What the run says it did not do:
Hold: a human merges thisper the issue's acceptance criteria; the lane writes the PR body, so I did not add it.Partial work is on the branch
work-resolve-issue/issue-7966-39105934408-1.Run: https://github.com/melodic-software/claude-code-plugins/actions/runs/39105934408
To retry, remove
needs-humanand addagent-readyagain.