Skip to content

docs(dev): note the squash-merged-parent gotcha in merge-policy#3657

Merged
mabry1985 merged 1 commit into
mainfrom
docs/merge-policy-stacked-parent-squash-gotcha
May 24, 2026
Merged

docs(dev): note the squash-merged-parent gotcha in merge-policy#3657
mabry1985 merged 1 commit into
mainfrom
docs/merge-policy-stacked-parent-squash-gotcha

Conversation

@mabry1985
Copy link
Copy Markdown
Contributor

Follow-up to PR #3653 (the original merge-policy doc).

Why

Three of us hit this in the same session shipping the #3597 stack: squash-merging the parent PR while a child PR was still open made the child's `base` ref evaporate (`delete_branch_on_merge: true` is on for this repo), and `gh` refused to create or render the child with:

```
Base ref must be a branch (createPullRequest)
```

The merge-policy doc already explained why stacked PRs should use Create a merge commit instead of squash, but didn't explicitly call out the consequence on the parent side. This PR fills that gap.

What's added

A new bullet under Stack hygiene → "Don't squash-merge a parent PR while children are still open" with two recovery paths:

  1. Preferred — keep Create a merge commit for stacked parents (already the policy default; this PR just makes the failure mode visible).
  2. If you've already squash-merged — rebase the child onto `main` (`git rebase --onto origin/main `) and re-target via `gh pr edit --base main`. Notes the `HEAD` vs branch-name gotcha that puts you in detached state.

🤖 Generated with Claude Code

Adds a "Don't squash-merge a parent PR while children are still open"
section to Stack hygiene. We hit this in the same session shipping
the #3597 stack: squash-merging the parent PR collapsed the head
branch (delete_branch_on_merge: true on this repo) and the child PR
refused to render with "Base ref must be a branch".

Two recovery paths documented:
1. Preferred — keep "Create a merge commit" for stacked parents (the
   policy default already; this PR makes the failure mode explicit).
2. If you've already squash-merged — rebase the child onto main and
   re-target. Calls out the HEAD-vs-branch-name detached-HEAD trap on
   `git rebase --onto X Y Z`.

Follow-up to PR #3653.
@mabry1985 mabry1985 enabled auto-merge (squash) May 24, 2026 07:18
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 24, 2026

Warning

Review limit reached

@mabry1985, we couldn't start this review because you've used your available PR reviews for now.

Your plan currently allows 6 reviews/hour. Refill in 4 minutes and 27 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 48324b0d-672b-425d-8b40-96f498283125

📥 Commits

Reviewing files that changed from the base of the PR and between 94bd6e5 and fe280c2.

📒 Files selected for processing (1)
  • docs/dev/merge-policy.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/merge-policy-stacked-parent-squash-gotcha

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

Code Review — ? finding(s)

Async review running parallel to CodeRabbit. Findings are advisory; not all are merge blockers.

protoLabs Code Review Report

  • Generated: 2026-05-24T07:18:29Z
  • Git head: 71695f324fbd2b2f0334d7f5bd5e7ae9b79d868c
  • Features mapped: 3
  • Findings: 0

No findings recorded.

@github-actions
Copy link
Copy Markdown
Contributor

@mabry1985 mabry1985 merged commit 90adc75 into main May 24, 2026
8 checks passed
@mabry1985 mabry1985 deleted the docs/merge-policy-stacked-parent-squash-gotcha branch May 24, 2026 07:19
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