Repository navigation
Abort PR pushes when Git cannot determine ancestry - #1239
Conversation
Architecture-Review: unchanged; Git still owns ancestry and a known divergent PR head still requires the exact lease. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on 4eb0f7d5c02eba6019b3ef9e4322f55738054a4c, 30.5s: approve (0 critical, 0 important, 1 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Native Claude output is retained in the restricted local review receipt.
| ["git", "merge-base", "--is-ancestor", sha, head], | ||
| cwd=wt, env_allowlist=worktree.GIT_ENV, timeout=GIT_TIMEOUT, | ||
| ) | ||
| if done.exit_code not in (0, 1): |
There was a problem hiding this comment.
suggestion: Stricter _is_ancestor also changes the delta-review message when the reviewed commit is missing
_is_ancestor now raises on any exit other than 0 or 1. That change also reaches _run_review (cli.py:984) and _delta_merge_recovery (cli.py:971). Before this change, a delta review whose reviewed SHA was missing from the local repo made git merge-base exit 128, which _is_ancestor read as 'not an ancestor'. The user then got the specific recovery guidance ("reviewed head … is not an ancestor of this branch. Find the original branch tip with git reflog …"). For example, this happens when another clone force-pushed the reviewed head and this repo never fetched it. Now the same case shows the generic "git merge-base --is-ancestor failed (exit 128): fatal: Not a valid commit name …". Failing closed is the right call, and both paths still abort. The cost is the actionable advice on that path, and no test covers the new review-side behaviour. Smallest fix: in _run_review, run the same cat-file -e <sha>^{commit} check used in cmd_pr before the ancestry probe and give a 'fetch it first' hint. Or add a test that pins the new message so the change is deliberate.
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Context and goal
Closes #1177
Acceptance
Supersedes #1202, whose conflict resolution requires a fresh review.
Validation
Recorded for
4eb0f7d5c02euv run --group dev ruff check src tests: exit 0uv run --group dev tach check: exit 0uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0scripts/size_budget.sh: exit 0uv run --group dev pytest -q: exit 0Seven focused CLI tests pass on the current head. They cover SIGTERM, fatal Git errors, unknown remote heads, regular pushes, and the exact force-with-lease path.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review