microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.17k stars 28.84k forks source link

SCM - have the ability to update the base branch #218017

Closed benibenj closed 1 month ago

benibenj commented 3 months ago

GHPR extension picks wrong base branch when: I branch off of main, create a commit without upstreaming it, then branching of this branch and adding a commit without upstreaming it. I then switching back to the previous branch and upstream it and move back to the child branch again and upstream and create a PR.

Start from main branch:

Additional info:

lszomoru commented 3 months ago

I will take a look as the "base branch calculation" is implemented in the vscode.git extension. //cc @alexr00 as FYI.

alexr00 commented 3 months ago

@benibenj showed me this, and my suspicion is that because the second branch is created before the first branch has an upstream, the first branch isn't getting picked as the vscode-merge-base, even though at the time that the git config is checked the first branch does have an upstream.

lszomoru commented 2 months ago

Since the merge-base is shown in the incoming/outgoing history graph, it is being computed when a new branch is created. As @alexr00 called out, since the first branch does not have an upstream when the second branch is created, we default to the default branch. I think that it would be confusing to automatically recalculate the merge-base, however I think that users should have a user gesture to be able to manually change the base that is being shown.

lszomoru commented 1 month ago

Closing this issue since "incoming/outgoing" has been moved into its own view which will implement its own way to select the branches that are being shown in the graph.