Replies: 1 comment
|
+1 (had to remove existing stack and re stack PRs) |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What happened
I had a two-PR stack,
main → A (open) → B, where B was later closed without merging. Its branch still exists, but the PR is closed for good.I then opened a new PR
Cthat branches offA(a sibling of B, not a descendant), and tried to append it:Because stacks are strictly linear and the closed B still occupies the only child slot under A, neither way forward is good:
gh stack link A B Ckeeps B, but rewrites C's base to B's branch, so C would be stacked on top of a closed, unmerged branch and its diff would change. Not what I want.gh stack unstack <n>thengh stack link A C. This works (what I did), but it tears down and recreates the whole stack object, so the stack gets a new number and any stack-level state is lost. That feels heavy for "drop a PR that was closed anyway".What I expected
A closed (not merged) PR is abandoned, so I'd expect it to stop participating in the stack. Either of these would have solved it:
linktreat closed PRs as removable without a full unstack, so the additive-only guard only protects open and merged PRs. A flag would be fine too if the strictness is deliberate.Right now the additive-only guard treats a closed PR as something worth protecting, which forces an unstack/relink cycle to make the stack reflect reality.
Minor related nit
To run
unstack <n>I needed the stack number, but my current branch was not in the stack, andgh stack view --jsononly works from a branch that is. There didn't seem to be a CLI way to ask "what stack is PR #A in?", so I got the number from GraphQL:{ repository(owner:"...", name:"..."){ pullRequest(number: A){ stack { number } } } }Something like
gh stack view --pr <number> --jsonwould have saved the detour. Happy to split that into its own discussion if you'd prefer.Versions
gh stackv0.0.8All reactions