Skip to content

docs(vcs): merging a stacked pull request without closing it - #845

Merged
blafourcade merged 1 commit into
nextfrom
docs/stacked-pull-request-merge
Sep 11, 2026
Merged

docs(vcs): merging a stacked pull request without closing it#845
blafourcade merged 1 commit into
nextfrom
docs/stacked-pull-request-merge

Conversation

@blafourcade

Copy link
Copy Markdown
Contributor

🎯 What & why

Merging a stack of pull requests closed one by accident (#843). After #818 merged, its branch was deleted through the API. #819 targeted that branch, and GitHub closed it instead of retargeting it: GitHub only retargets when the merge itself deletes the branch. Recovering took recreating the branch at its old SHA, reopening and retargeting #819, then rebasing it, because #818 had been squashed.

🛠️ How it works

A new "Pull requests" section in aidd_docs/memory/vcs.md:

  • retarget a dependent pull request to next before merging its base, and never delete a branch another open pull request targets;
  • after a squash merge of the base, replay only the dependent branch's own commits with git rebase --onto origin/next <base's last commit>, then push with --force-with-lease.

🧪 How to verify

  • Read the section in aidd_docs/memory/vcs.md.
  • pre-commit runs check-doc-duplication.js, so no other page restates the rule.

⚠️ Heads-up

  • Documentation only.

🔗 Linked issue

Fixes #843

✅ I certify

  • I DO CERTIFY I READ EACH LINE OF THE PULL REQUEST BECAUSE I AM A SOFTWARE ENGINEER, NOT A AI PUPPY.

🤖 Generated with Claude Code

https://claude.ai/code/session_011x4ms5qcGuZgYhCxfdHMUb

GitHub closes a pull request whose base branch is deleted, unless the merge
itself deletes it. Deleting the base of #819 through the API after #818
merged closed #819 instead of retargeting it. `vcs.md` now says to retarget
first, and how to replay a dependent branch after its base was squashed.

Fixes #843

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011x4ms5qcGuZgYhCxfdHMUb
AIDD-Session-Id: 4acc9a1c-19bc-4468-b8b6-e86644bcba60
@blafourcade
blafourcade requested a review from a team as a code owner September 11, 2026 03:55
@blafourcade
blafourcade merged commit b630704 into next Sep 11, 2026
24 checks passed
@blafourcade
blafourcade deleted the docs/stacked-pull-request-merge branch September 11, 2026 07: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