Closed benibenj closed 1 month ago
I will take a look as the "base branch calculation" is implemented in the vscode.git extension. //cc @alexr00 as FYI.
@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.
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.
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.
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:
git checkout -b test1
git checkout -b test2
git checkout test1
git checkout test2
main
as base branch, would have expectedtest1
Additional info:
githubPullRequests.createDefaultBaseBranch: auto
git config --local branch.test2.vscode-merge-base [88ms]