Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List of repos in the Source Control panel is no longer sorted consistent with the Explorer Panel #146409

Closed
robcowart opened this issue Mar 31, 2022 · 12 comments
Assignees
Labels
feature-request Request for new features or functionality git GIT issues on-testplan
Milestone

Comments

@robcowart
Copy link

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

Version: 1.66.0
Commit: e18005f
Date: 2022-03-30T05:50:04.419Z
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Darwin x64 21.2.0

Steps to Reproduce:

  1. Add multiple repos to a Workspace.
  2. Compare the ordering between the two panels.

Up until the release above, the order of repos in the Source Control panel was consistent with the order of the Explorer Panel. This made it very easy to move between panels and easily find things. This newly introduced inconsistency slows productivity, especially for Workspaces with many repositories.

Notice the different ordering in the images below.

image

image

@robcowart
Copy link
Author

robcowart commented Mar 31, 2022

Note that I see this in the release notes... https://code.visualstudio.com/updates/v1_66#_source-control-repositories-view

The problem here is that the change was attempting to fix an issue that never existed. It states...

"This was problematic as the discovery order can vary and repositories appeared to be in random order."

This is simply not true. The order did not appear "random". It was exactly the same as the arrangement of repositories in the Explorer panel, which makes total sense. If I put the primary repo for the project at the top of the explorer panel, it is logical for it to also be at the top of the Source Control panel.

If a change like this is made, it should at least have a toggle to allow users to choose to remain with the previous behavior.

@gjsjohnmurray
Copy link
Contributor

/assign @lszomoru

@Lemmingh
Copy link
Contributor

Sounds like a duplicate. Some people love to sort things by name (#43527), while others prefer discovery order (#146359).


More context (#145886 (comment)):

repositories were being showing in the order in which they were discovered.

it certainly looked random (as discovery order can vary) for folders/workspaces with a large number of repositories and it was a real pain point.


Besides, I noticed that the work item on the iteration plan (#144519) was called:

Provide sorting options for repositories in the SCM view

@robcowart
Copy link
Author

I see discussion of the order being "discovered", but see no clarity on what "discovered" actually means. To be clear, I am referring to the behavior where Source Control sorting follows Explorer sorting. For example...

Version: 1.65.1
Commit: 8908a9c
Date: 2022-03-08T02:20:11.670Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 21.2.0

The order in Explorer...

image

Is mirrored in Source Control...

image

If the repos are reordered via drag and drop in Explorer...

image

The new order is also picked up by Source Control...

image

This is how it has worked for a long as I have worked with Workspaces, and should at least be preserved as an option if not the kept as the default behavior.

@lszomoru lszomoru added the git GIT issues label Mar 31, 2022
@lszomoru
Copy link
Member

@robcowart, thank you very much for your feedback.

Let me try to provide a little bit more context on repository "discovery". When you open a folder/workspace in VS Code, the git extension will perform an initial scan for the find the git repositories that should be displayed in the SCM viewlet ("Source Control Repositories" and "Source Control" views). During the initial scan we look at the workspace folders, opened editors, and we crawl the workspace folders N levels deep (default value is 1) to look for git repositories.

If the .git folder is an immediate child folder of a workspace folder, than things are pretty straightforward but things can appear random if the repositories are deeper down a workspace folder, or if you have opened editors that contain files from outside the workspace that you have opened.

I am planning on providing more options for sorting, and users will be able to easily restore the sort order that was previously available. I am hoping to have that capability available early next week in Insiders and in the next Stable release.

@lszomoru lszomoru added this to the April 2022 milestone Mar 31, 2022
@robcowart
Copy link
Author

@lszomoru thanks for the clarification and sharing your next steps.

@sandercox
Copy link

@lszomoru please add the option to sort by name but keep the main repository at the top. I have folder with submodules and it's really annoying now my 'main' repo changes are no longer just at the top but could be anywhere were they would make sense alphabetically.

Maybe even sort by full path name as that mimicks repository layout the best I guess?

@lszomoru
Copy link
Member

@sandercox, yes, sorting by full path is something that is on my list. Will keep the issue updated with my progress.

@lszomoru lszomoru added the feature-request Request for new features or functionality label Mar 31, 2022
@FStefanni
Copy link

Hi,

same problem here: I prefer the .code-workspace sort order.
I believe that adding an option for people preferring the "old" sorting could be nice.

Regards.

@SimonHarrisonSH
Copy link

Please, please get this fixed asap. There was nothing to "fix" in the first place. I have a dozen repo's in my workspace and the two main ones were at the top, now they're somewhere in the middle. This is really, really, annoying.

@maidh91
Copy link

maidh91 commented Apr 4, 2022

Yeah, agree, please fix this asap. Love team!

@lszomoru
Copy link
Member

Today's Insiders release (2022-04-14), contains two changes related to repository sorting:

  • The default sorting was reverted to be by discovery time, which was the original behaviour
  • A new setting scm.repositories.sortOrder was added that can be used to control the repository sorting (discovery time, name, path)

@github-actions github-actions bot locked and limited conversation to collaborators May 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality git GIT issues on-testplan
Projects
None yet
Development

No branches or pull requests

8 participants