fix(hooks): commit guards match `git commit-tree` as `git commit` (unanchored substring)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 83/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- git, github, typescript
Research direction
Start in hooks/pre-tool.sh, where the issue identifies the seg_match callers and raw_commit_segment as matching git commit too broadly. Read those checks and the related hook tests, then reproduce with the supplied git commit-tree command. Add a regression case showing plumbing commands pass through while porcelain git commit guards still work.
Written by the indexing model from the issue text.
Description
Bug Description
The commit guards in hooks/pre-tool.sh match git commit as an unanchored substring, so they also fire on the plumbing command git commit-tree, which doesn't commit staged files at all.
- The no-changes guard (
seg_match 'git commit', about line 1222 in 2.20.0) runsgit status --porcelain, sees a clean tree (which is normal forcommit-tree, since it builds a commit from an existing tree object), and blocks withHOOK_BLOCKED: No changes to commit. Stage files with 'git add' first. raw_commit_segmentselects segments that contain the literal substring "git commit", so agit commit-tree … -m "<msg>"would also have its message checked by the conventional-commit validator.
Seen on 2026-11-08 in a downstream graph repo. Under Claude Code auto mode, force-push is denied. To update a PR branch with a verified rebase, the runner tried to publish the rebased tree as a merge commit: git commit-tree HEAD^{tree} -p <pr-head> -p <main> -m …, then a normal push. The hook blocked it, so the runner fell back to git merge --no-commit plus git checkout <sha> -- ., which took two extra calls.
Steps to Reproduce
- In a clean checkout with the hook installed, run:
git commit-tree HEAD^{tree} -p HEAD -m "chore: test" - The hook blocks with
HOOK_BLOCKED: No changes to commit.
Expected Behavior
The commit guards match git commit only as a whole word, for example git commit([[:space:]]|$), so commit-tree and commit-graph pass through. Other git commit-* plumbing is never a porcelain commit of staged changes.
Related
#1663: the same guard checks the tree before a compound command runs. That issue is about when the guard checks; this one is about what it matches.
Complexity
Small. It's a regex anchor in seg_match callers and raw_commit_segment, plus a test case.
Area
hooks
Environment
sequant 2.20.0, Claude Code VS Code extension, macOS, zsh.
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 1
- Avg merge
- 10h 12m
- Merged PRs (30d)
- 78
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sequant-io/sequant
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
sequant-io/sequant#1682 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
sequant-io/sequant#1680 ·
Maintainers usually reply within 1 day
-
fix(assess): minimal-flags rule still assumes a ui label adds the test phase (stale after #1649)Open
Difficulty 1/5 1-3 hours Newbie friendliness 87/100
sequant-io/sequant#1662 ·
Maintainers usually reply within 1 day
-
docs(ready): the ready gate's docs drop the second-look claim — describe the qa → loop → qa mechanism and its policy, cite #1344 for what was measuredPossibly taken @admarble claimed this today. Opengraph-2026-11-simplify planned
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
sequant-io/sequant#1650 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
sequant-io/sequant#1601 ·
Maintainers usually reply within 1 day
All issues in sequant-io/sequant
Similar issues
-
maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
assistant-ui/assistant-ui#10499 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug server-sequentialthinking v2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
modelcontextprotocol/servers#5526 · 1 comment ·
Maintainers usually reply within 1 day
-
app-server bug CLI
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
cimd: default originBoundFields rejects a cross-origin client_uri, which the CIMD draft forbidsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
better-auth/better-auth#12458 · 1 reaction ·
Maintainers usually reply within 1 day