fix(claude): narrow and ask before landing merges #217
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/merge-exclusion-options"
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?
Why
Issue #214: the sandbox exclusion for the landing merge,
git merge --ff-only *, lets a merge with any trailing options leavethe sandbox, so the call that runs outside it can do more than a
fast-forward. No ask rule covers it either, so where a developer's own
settings allow
git merge, it runs unasked. An ask rule on everygit mergewas weighed and set aside, since merges inside the sandboxalready stay under the
Readrules.What changed
Only
git merge --ff-only --end-of-options <rev>now leaves thesandbox, and
deliver'sland.mdlands in that form; after--end-of-optionsgit takes every argument as a revision and refuses anoption. A new ask rule,
Bash(git merge --ff-only *), has the landingmerge ask first, whatever the developer's own allow rules say.
docs/SANDBOX.mdand the README name the new form and say the mergealways asks, while
run-sandboxed.shstill asks as the permission modedecides. Not a breaking change: an adopted repository's
land.mdtakesthe new form through
foundry-upgrade.How to verify
In a Claude Code session on this branch, with the sandbox on, land a
branch from the main checkout with
git merge --ff-only --end-of-options <branch>: Claude Code asks, andthe merge runs outside the sandbox. Then run
git merge --ff-only --end-of-options --no-ff <branch>in a scratchrepository: git refuses it with
--no-ff - not something we can merge,where
git merge --ff-only --no-ff <branch>makes a merge commit.The checks of
docs/MAINTENANCE.mdpass on the tip, and the twoextended tests of
tests/agent-config/claude-settings.shfail onmain. The bubblewrap tests and evals could not run inside ClaudeCode's sandbox.
Considerations
That the ask rule prompts in
bypassPermissionsmode rests on the samebehaviour
0593332states for theEditask rules, unconfirmed here fora
Bashrule; auto mode is confirmed.--end-of-optionsbeforegit merge's revisions was checked on git 2.53.0 only, within theREADME's Git 2.48 floor.