When reordering two PRs in a stack, pushing the updated stack causes the PR moved down in the stack to be auto-closed.
For example:
touch A
sl addremove
sl commit -m "A"
touch B
sl addremove
sl commit -m "B"
sl pr submit
# Rewrite the stack from A, B to B, A
sl histedit
sl pr submit
PR for B will be auto-closed. Confusingly, GitHub will actually report it as "merged" into main, even though nothing has actually been merged. (e.g. neildhar/test#2)
This seems to happen when the branches are pushed. After the first round we have:
- First PR merging
prA -> main
- Second PR merging
prB -> prA
My understanding is that we only update the PR metadata after all branches are pushed. So when we push both branches, the second PR appears to have already been merged, because its commit is present in the base branch prA, and GitHub closes the PR as merged.
If so, perhaps one possible solution is to interleave the pushing the branches and updating the PR metadata. That is, instead of:
- Push branches
prA and prB
- Update metadata for first and second PR
We do:
- Push branch
prB
- Update metadata for second PR to be
prB->main
- Push branch
prA
- Update metadata for first PR to be
prA->prB
When reordering two PRs in a stack, pushing the updated stack causes the PR moved down in the stack to be auto-closed.
For example:
PR for B will be auto-closed. Confusingly, GitHub will actually report it as "merged" into main, even though nothing has actually been merged. (e.g. neildhar/test#2)
This seems to happen when the branches are pushed. After the first round we have:
prA -> mainprB -> prAMy understanding is that we only update the PR metadata after all branches are pushed. So when we push both branches, the second PR appears to have already been merged, because its commit is present in the base branch
prA, and GitHub closes the PR as merged.If so, perhaps one possible solution is to interleave the pushing the branches and updating the PR metadata. That is, instead of:
prAandprBWe do:
prBprB->mainprAprA->prB