vscode: Source Control bug when creating or changing branch in the workspace

Working with several projects in a workspace, I create and/or change a branch in one project and it creates and/or changes the branch for every project in the workspace.

https://user-images.githubusercontent.com/3662505/136525323-34b5d888-e06a-426c-a5c6-b039db4001d8.mov

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.61.0
  • OS Version: macOS Big Sur 11.5.2

Steps to Reproduce:

  1. Open a workspace with several projects
  2. Try to create/change branch on one project
  3. It will create/change the branch for every project

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 42
  • Comments: 26 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Can you try disabling scm.showActionButton in your user settings to see if it fixes the problem?

/assign @eamodio

Looks serious enough for a recovery release.

@mattseddon I confirm that disabling scm.showActionButton it fixes the problem for me

It also displays commits to be synced for both projects.

It should just display the commit for the project the commit actually belongs to.

image Sorry for the lazy report.

Version: 1.61.0 (system setup)
Commit: ee8c7def80afc00dd6e593ef12f37756d8f504ea
Date: 2021-10-07T18:13:09.652Z
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19043

@mattseddon Yes confirmed. It fixes the problem. ๐Ÿ™‚

Bug details:

When repository.provider.onDidChange fires, there are 3 listeners:

Consider repo A and B. The problem arises when that event fires for repo B:

  • The second listener will rerender the subtree of repo B. Given that this is a compressible tree, the render will actually occur on the subtree rooted at Bโ€™s parent: that is, the entire tree will be rerendered.
  • The tree will decouple template rows with the model. But the third listener will still run! ๐Ÿ™ˆ
  • The tree will reuse templates in reverse order, so when repo A gets rendered it will get the template from repo B.
  • The third listener will run against a reused template row, rendering the branch of repo B on the wrong row, which now belongs to repo A.

Patch fix is to check whether the template element has been disposed in the third listener.

Proper fix is to add fine grained events to ISCMProvider.onDidChange.

Huge thanks to @gjsjohnmurray and @IllusionMH for helping out with the issue onslaught management. Youโ€™re the real MVPs! ๐Ÿ™

Iโ€™ve pinned this issue, just so people can find it more easily instead of filing dupes.

image if I press in check in top sub panel cursor jump to buttom sub panel with another git sub repository

I can confirm that even with Show Action Button disabled, I still get the jumping cursor on 1.61.1

https://www.dropbox.com/s/9rul5jjgs7zlq9v/Screen Recording 2021-10-15 at 09.09.56.mov?dl=0

A new version of vs code 1.61.1 has been released, this should fix this issue

Sorry about the delay on this one. I will take a look at this one first thing tomorrow morning.

Also, my previous idea at #132369 might have got enough extra eyes onto 1.61 during endgame week to have detected this particular problem before shipping. Itโ€™s a only Backlog Candidate at the moment and currently needs 12 more upvotes to progress to Backlog. ๐Ÿ™

not fixed all bugs

I think focus change on list update is old issue with reports for 1.59.0 https://github.com/microsoft/vscode/issues/130204 1.53.2 https://github.com/microsoft/vscode/issues/116930 And 1.47.0 https://github.com/microsoft/vscode/issues/102498 that supposed to be fixed for staging files

Itโ€™s better to keep track of focus in separate issue rather than in closed issue for related but different topic. #135143 is reported for latest version - please upvote it.