Standardize selection of upstream branches #4295
Draft
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.
Changes the behavior of all upstream related commands I could find to behave similar to how multi-remote pull requests currently behave:
The new flow behaves as I describe in the comment I wrote:
Creates a series of two prompts that will gather an upstream remote and branch from the user.
The first prompt gathers the remote name, with a pre-filled default of origin, or the first remote in the list.
After selecting a remote, only branches present on that remote will be displayed.
If there is only one remote in the current repository, the remote prompt will be skipped.
For users who only work on single-remote repositories, this should be basically unchanged, with the exception of the prompt they are displayed. (They no longer have the option to enter a remote at all, since they only have 1 choice).
For users who work in multi-remote repositories, I hope this flow should be quite smooth! The most controversial choice I made was pre-filling the default repository. In my head, users are dealing with a small number of remotes (<5), and probably still dealing with the primary more often than not. Therefore, having it prefilled can save them a keystroke in many cases, and when they need other remotes, they can press tab and arrow down.
If we want to change the behavior so the default remote is never filled, I am totally open to that option!
Currently have in a draft because I know I need to do some internationalization.
Implements #4292
go generate ./...
)