Repository: vscode
Issue: Source  Control View: Sort by path does not work as expected for submodules
Labels: bug,scm


Issue Type: <b>Bug</b>

I have a workspace with two repositories (both located in the same directory), each with a multi level tree of submodules. Expected sort order:

a
a/common1
a/common1/foo
a/common1/foo/bar
a/x
a/x/common2
b
b/common1
b/common1/foo
b/y
b/y/common2

But I get the following order:

a
b
a/common1
a/x
a/common1/foo
a/common1/foo/bar
a/x/common2
b/common1
b/y
b/common1/foo
b/y/common2

So essentially repositories appear to be sorted by the path to the parent directory instead of the full path of the repository.

In my actual case there is an additional (non-repo) directory between each repository and its subrepos (e.g. a/external/common1 or a/external/x/external/common2) but that should not affect sort order so I left it out of the example for readability. (I can't readily test if the sort order changes without these intermediate directories.)

VS Code version: Code 1.67.0 (57fd6d0195bb9b9d1b49f6da5db789060795de47, 2022-05-04T12:08:42.978Z)
OS version: Linux x64 5.15.26-gentoo
Restricted Mode: No
Remote OS version: Linux x64 5.13.0-35-generic
Remote OS version: Linux x64 5.13.0-35-generic
Remote OS version: Linux x64 5.13.0-35-generic
Remote OS version: Linux x64 5.13.0-35-generic
Remote OS version: Linux x64 5.13.0-35-generic
Remote OS version: Linux x64 5.13.0-35-generic

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|AMD Ryzen 5 1600 Six-Core Processor (12 x 1550)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>oop_rasterization: disabled_off<br>opengl: enabled_on<br>rasterization: disabled_software<br>raw_draw: disabled_off_ok<br>skia_renderer: enabled_on<br>video_decode: disabled_software<br>video_encode: disabled_software<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled|
|Load (avg)|2, 2, 2|
|Memory (System)|47.06GB (14.37GB free)|
|Process Argv|--unity-launch|
|Screen Reader|no|
|VM|0%|
|DESKTOP_SESSION|/usr/share/xsessions/plasma|
|XDG_CURRENT_DESKTOP|KDE|
|XDG_SESSION_DESKTOP|KDE|
|XDG_SESSION_TYPE|x11|

|Item|Value|
|---|---|
|Remote|SSH: dsdev|
|OS|Linux x64 5.13.0-35-generic|
|CPUs|Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz (8 x 2494)|
|Memory (System)|31.35GB (3.33GB free)|
|VM|100%|

|Item|Value|
|---|---|
|Remote|SSH: dsdev|
|OS|Linux x64 5.13.0-35-generic|
|CPUs|Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz (8 x 2494)|
|Memory (System)|31.35GB (3.32GB free)|
|VM|100%|

|Item|Value|
|---|---|
|Remote|SSH: dsdev|
|OS|Linux x64 5.13.0-35-generic|
|CPUs|Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz (8 x 2494)|
|Memory (System)|31.35GB (3.32GB free)|
|VM|100%|

|Item|Value|
|---|---|
|Remote|SSH: dsdev|
|OS|Linux x64 5.13.0-35-generic|
|CPUs|Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz (8 x 2494)|
|Memory (System)|31.35GB (3.32GB free)|
|VM|100%|

|Item|Value|
|---|---|
|Remote|SSH: dsdev|
|OS|Linux x64 5.13.0-35-generic|
|CPUs|Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz (8 x 2494)|
|Memory (System)|31.35GB (3.32GB free)|
|VM|100%|

|Item|Value|
|---|---|
|Remote|SSH: dsdev|
|OS|Linux x64 5.13.0-35-generic|
|CPUs|Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz (8 x 2494)|
|Memory (System)|31.35GB (3.32GB free)|
|VM|100%|
</details><details><summary>Extensions (30)</summary>

Extension|Author (truncated)|Version
---|---|---
js-debug-companion|ms-|1.0.18
better-comments|aar|3.0.0
auto-close-tag|for|0.5.14
auto-rename-tag|for|0.1.10
remote-ssh|ms-|0.78.0
remote-ssh-edit|ms-|0.80.0
material-icon-theme|PKi|4.17.0
highlight-matching-tag|vin|0.10.1
vscode-todo-highlight|way|1.0.5
material-theme|zhu|3.13.25
ng-template|Ang|13.3.2
npm-intellisense|chr|1.4.1
vscode-markdownlint|Dav|0.47.0
vscode-eslint|dba|2.2.2
githistory|don|0.6.19
gitlens|eam|12.0.6
vscode-npm-script|eg2|0.3.25
prettier-vscode|esb|9.5.0
go|gol|0.33.0
todo-tree|Gru|0.0.215
ds-code|kai|0.0.1
git-graph|mhu|1.30.0
cmake-tools|ms-|1.10.5
cpptools|ms-|1.9.8
vscode-typescript-tslint-plugin|ms-|1.3.4
vscode-taskexplorer|spm|2.9.1
cmake|twx|0.0.17
clang-format|xav|1.9.0
html-css-class-completion|Zig|1.20.0
vscode-proto3|zxh|0.5.5


</details>
<!-- generated by issue reporter -->