fix(hooks): git pull and branch -d slip the CLI-steering guard #352
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#352
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The PreToolUse git-steering hooks (
check-git-local.sh/check-git-remote.sh) route most raw git to the matchingmadt_*tool, but a few common verbs still pass through unblocked. I hit this doing post-finishhousekeeping, where this whole compound ran with no guard firing:Each verb has a
madt_*equivalent, so none of it should have been raw git:git pull(own repo) - not steered.check-git-remote.shlets it through because raw pull is credential-safe (git strips the token from display), but credential-safety is not the same as sanctioned. It should route tomadt_pull.git branch -d <name>- thecheck-git-local.shheader already documents this as steering tomadt_branch_delete, but it did not fire here. Likely a classifier gap whenbranch -dis the trailing segment of an&&chain; worth confirming with a compound-command test.git switch <existing-branch>- silent by design today (same-repo navigation). Lower priority, but "return to mainline after finish" is exactly where the reflex to shell out shows up, so it may be worth a gentle nudge toward the madtea flow too.Keep it verb-specific, NOT a blanket
gitblock:status/diff/logand same-repo navigation stay free. The ask is to close thepullandbranch -dholes, and decide what to do about the switch case.Repro: single Bash invocation, the three commands joined by
&&.