fix(hooks): commit guards match `git commit-tree` as `git commit` (unanchored substring)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 83/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- git, github, typescript
Hướng nghiên cứu
Bắt đầu trong hooks/pre-tool.sh, nơi issue xác định rằng các chỗ gọi seg_match và raw_commit_segment khớp với git commit quá rộng. Đọc các bước kiểm tra đó và những bài kiểm thử hook liên quan, sau đó tái hiện bằng lệnh git commit-tree được cung cấp. Thêm một trường hợp hồi quy cho thấy các lệnh plumbing được đi qua, trong khi các bước bảo vệ cho lệnh porcelain git commit vẫn hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 1
- Fork
- 1
- Merge trung bình
- 10 giờ 12 phút
- Pull request đã merge (30 ngày)
- 78
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của sequant-io/sequant
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
sequant-io/sequant#1682 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
sequant-io/sequant#1680 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(assess): minimal-flags rule still assumes a ui label adds the test phase (stale after #1649)Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 87/100
sequant-io/sequant#1662 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
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 measuredCó thể đã có người làm @admarble đã nhận hôm nay. Đang mởgraph-2026-11-simplify planned
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
sequant-io/sequant#1650 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
sequant-io/sequant#1601 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của sequant-io/sequant
Issue tương tự
-
maintenance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
assistant-ui/assistant-ui#10499 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug server-sequentialthinking v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
modelcontextprotocol/servers#5526 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
app-server bug CLI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
cimd: default originBoundFields rejects a cross-origin client_uri, which the CIMD draft forbidsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
better-auth/better-auth#12458 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày