Repository navigation
Support modifying partially merged stacks - #575
Merged
skarim merged 3 commits intoOct 21, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Persistent recovery transitions need human validation, and a stale PR-state issue remains in partial-unstack retries.
1 open issue
What changed in this PR
Supports submitting modifications to partially merged stacks while preserving local branch history.
Changes:
- Accept merged-only remote remnants during recovery.
- Exclude historical merged PRs from replacement stacks.
- Align checkout membership checks and expand regression coverage.
| File | Description |
|---|---|
| cmd/submit.go | Updates recovery, completion, and remote membership handling. |
| cmd/submit_test.go | Adds partial-unstack, retry, and membership tests. |
| cmd/checkout.go | Ignores historical merged nonmembers when comparing stacks. |
| cmd/checkout_test.go | Tests historical and current merged membership. |
Review effort: Balanced
skarim
force-pushed
the
skarim/fix-modify-partial-merge
branch
from
October 21, 2026 19:48
e07fe2d to
01c65b6
Compare
Lukeghenco
approved these changes
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Allows
gh stack submitto finish a modification when GitHub keeps merged PRs in the old stack. The local branch list is preserved, while the replacement stack contains only the remaining work.Functionality and user impact
Key areas to review
cmd/submit.go:175-201andcmd/submit.go:287-297:runSubmithandles pending modify recovery before considering an automatic fork. Completion counts active branches rather than historical entries, so one remaining PR can finish without a replacement stack.cmd/submit.go:688-711andcmd/submit.go:752-800:prepareStackRecreationrecognizes merged-only remnants and records fresh merge state.handlePendingModifyaccepts those outcomes and persists the completed unstack step before clearing the local remote identity; the recovery record remains until submission finishes.cmd/submit.go:851-864/cmd/checkout.go:542-545:stackPRNumberssupplies the create/adopt/update membership rule, andstackCompositionMatchesreuses it. Check that historical PRs are excluded without dropping merged members of the stack being reconciled.Related issues
Stack created with GitHub Stacks CLI • Give Feedback 💬