CLI stack sync should detect an existing remote Stack #238
onereg-felix
started this conversation in
Feedback
Replies: 0 comments
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.
-
Issue
A Stack can exist on GitHub while its branches are not tracked locally by
gh stack. In that state, the GitHub UI correctly shows the Stack, but runninggh stack syncfrom one of its branches reports that the branch is not part of a stack. This makes the local CLI and GitHub UI appear to disagree, and the recovery path is not discoverable fromsync.GitHub Stack membership and local
gh-stacktracking are separate states, but that distinction is not visible to users. Detecting the remote Stack would makesyncresilient when a Stack was created from another machine, through the web UI, or usinggh stack link.Rep steps
Create or link a Stack on GitHub, for example with
gh stack linkor the web UI.Check out one of the Stack's branches in a local clone that does not have the corresponding
gh-stackmetadata.Run:
gh stack syncThe command reports:
The branch's pull request is nevertheless part of a Stack on GitHub.
Expected behaviour
gh stack syncshould check whether the current branch has an open pull request that belongs to a remote Stack before concluding that it is unstacked.When exactly one Stack is found, the CLI could:
--import-remote; orgh stack checkout <pr-number>command required to establish local tracking.The command should perform no rebase or push until the remote Stack has been imported successfully and any local divergence has been reported.
Beta Was this translation helpful? Give feedback.
All reactions