Skip to content

Allow git merge without prompting - #312

Merged
ikuwow merged 1 commit into
mainfrom
claude/git-merge-ask-removal
Jul 20, 2026
Merged

Allow git merge without prompting#312
ikuwow merged 1 commit into
mainfrom
claude/git-merge-ask-removal

Conversation

@ikuwow

@ikuwow ikuwow commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

Move Bash(git merge *) from the ask list to the allow list in claude/settings.json, so git merge runs without a permission prompt.

Background

Ask rules take precedence over allow rules ("a matching ask rule prompts even when a more specific allow rule also matches the same call" — https://code.claude.com/docs/en/permissions ), so every merge prompted even though the blanket Bash(git *) allow matched. This blocked subagents from resolving PR branch conflicts: a permission prompt raised from a background agent gives the user no context about which branch is being merged into, so it cannot be approved meaningfully.

Why an explicit allow entry (and why removing the ask rule alone is not enough)

Risk assessment

git merge is local-only and recoverable:

  • Committed state stays permanently reachable via the merge commit's first parent (and git reflog, 90-day default per man git-gc)
  • A merge that would overwrite uncommitted changes or untracked files refuses to start
  • The remote is untouched until a separate git push
  • After a push, undo is git revert -m 1 <merge commit> (force push stays denied)

The genuinely destructive git commands (reset --hard, clean, stash drop/clear, rebase, commit --amend) stay in ask/deny.

Interaction with #208

#208's branch (feature/explicit-git-allowlist-187) also deletes the Bash(git merge *) ask entry, so the ask-side change merges cleanly either way. The new allow entry sits next to Bash(git *), which #208 replaces; the expected resolution is to keep this entry in #208's allowlist.

Verification

  • jq -e '.permissions.allow | index("Bash(git merge *)")' returns an index; the same lookup on .permissions.ask returns null
  • pre-commit ran on the commit: Check JSON.....Passed (hook output at commit time)
  • After merge + settings reload: a subagent git merge origin/main on a feature branch runs without a permission prompt

Move Bash(git merge *) from the ask list to the allow list. The ask
rule forced a prompt on every merge even though the blanket
Bash(git *) allow matched (ask rules take precedence over allow), which
blocked subagents from resolving PR branch conflicts: a background
permission prompt gives the user no context about which branch is
being merged into.

The explicit allow entry is redundant with Bash(git *) today, but
becomes load-bearing once #208 replaces the blanket with an explicit
allowlist: without it, merges would fall through to the auto-mode
classifier (occasional transient-error denials) or a manual-mode
prompt.

git merge is local-only and recoverable: committed state stays
reachable via the merge commit parents, uncommitted work aborts the
merge instead of being overwritten, and nothing touches the remote
until a separate push.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RGD2NDthkx859WNGeDKKBN
@ikuwow
ikuwow marked this pull request as ready for review July 20, 2026 14:42
@ikuwow
ikuwow merged commit fdff848 into main Jul 20, 2026
6 checks passed
@ikuwow
ikuwow deleted the claude/git-merge-ask-removal branch July 20, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant