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

Git show duplicate repositories located on UNC paths #112231

Open
AnrDaemon opened this issue Dec 10, 2020 · 28 comments
Open

Git show duplicate repositories located on UNC paths #112231

AnrDaemon opened this issue Dec 10, 2020 · 28 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues

Comments

@AnrDaemon
Copy link

Issue Type: Bug

image

The only difference between these two repos is the host case.
One spelled in uppercase, another spelled in lowercase.
I have to repeatedly close one of the repos to reduce network load from concurrently running git processes.

VS Code version: Code 1.51.1 (e5a624b, 2020-11-10T23:34:32.027Z)
OS version: Windows_NT x64 6.1.7601

System Info
Item Value
CPUs Intel(R) Core(TM) i5-3550 CPU @ 3.30GHz (4 x 3292)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.96GB (5.13GB free)
Process Argv \DAEMON-EC.DARKDRAGON.LAN\anrdaemon\Documents\caduceus\bach-x5-gui --crash-reporter-id d05c8b79-33ba-42b6-8c5c-db1f4b0e913c
Screen Reader no
VM 0%
Extensions (7)
Extension Author (truncated) Version
vscode-intelephense-client bme 1.5.4
gitlens eam 11.0.6
EditorConfig Edi 0.16.4
php-debug fel 1.13.0
todo-tree Gru 0.0.190
composer ika 0.7.1
sqltools mtx 0.23.0
@AnrDaemon
Copy link
Author

#107401 possibly related

@AnrDaemon
Copy link
Author

AnrDaemon commented Dec 24, 2020

Also #92945

Which subsequently causes xdebug/vscode-php-debug#320

@AnrDaemon
Copy link
Author

Even vscode "$( cygpath -alw "$_arg" | sed -Ee '/^\\\\/s/^\\\\[^\\]+\\/\L\0/;' )" does not help.

Wonder where did VS Code do get the two paths.

@AnrDaemon
Copy link
Author

This image should be more illustrative.

image

(The program was started with lowercase host name.)

@eamodio
Copy link
Contributor

eamodio commented Jan 5, 2021

Can you provide the contents of the Git Output panel when you first open the folder?

@eamodio eamodio added bug Issue identified by VS Code Team member as probable bug git GIT issues info-needed Issue requires more information from poster labels Jan 5, 2021
@eamodio eamodio added this to the Backlog milestone Jan 5, 2021
@eamodio
Copy link
Contributor

eamodio commented Jan 5, 2021

Probably related to #100274 and #113363

@AnrDaemon
Copy link
Author

AnrDaemon commented Jan 7, 2021

When started with lowercase host:

Looking for git in: C:\Programs\Git\bin\git.exe
Using git 2.28.0.windows.1 from C:\Programs\Git\bin\git.exe
> git rev-parse --git-dir
Open repository: \\<host>\anrdaemon\Documents\<repo>
> git status -z -u
> git check-ignore -v -z --stdin
> git symbolic-ref --short HEAD
> git rev-parse <branch>
> git rev-parse --symbolic-full-name <branch>@{u}
> git rev-list --left-right <branch>...refs/remotes/origin/<branch>
> git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname)
> git remote --verbose
> git config --get commit.template
> git rev-parse --git-dir
Open repository: \\<HOST>\anrdaemon\Documents\<repo>
> git status -z -u
> git check-ignore -v -z --stdin
> git check-ignore -v -z --stdin
> git symbolic-ref --short HEAD
> git rev-parse <branch>
> git rev-parse --symbolic-full-name <branch>@{u}
> git rev-list --left-right <branch>...refs/remotes/origin/<branch>
> git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname)
> git remote --verbose
> git config --get commit.template
> git show --textconv :<repo>/includes/api.php
> git show --textconv :<repo>/includes/messages.php
> git ls-files --stage -- \\<host>\anrdaemon\Documents\<repo>\<path>\includes\api.php
> git ls-files --stage -- \\<HOST>\anrdaemon\Documents\<repo>\<path>\includes\messages.php
> git cat-file -s db7cda155b5a8180b600615c0a882ceffa108ab7
> git cat-file -s af6c2b3341881bf4eb845cd08d1001c6d8414de7
> git check-ignore -v -z --stdin

When started with uppercase host:

Looking for git in: C:\Programs\Git\bin\git.exe
Using git 2.28.0.windows.1 from C:\Programs\Git\bin\git.exe
> git rev-parse --git-dir
Open repository: \\<HOST>\anrdaemon\Documents\<repo>
> git status -z -u
> git check-ignore -v -z --stdin
> git symbolic-ref --short HEAD
> git rev-parse <branch>
> git rev-parse --symbolic-full-name <branch>@{u}
> git rev-list --left-right <branch>...refs/remotes/origin/<branch>
> git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname)
> git remote --verbose
> git config --get commit.template
> git rev-parse --git-dir
Open repository: \\<host>\anrdaemon\Documents\<repo>
> git status -z -u
> git check-ignore -v -z --stdin
> git check-ignore -v -z --stdin
> git symbolic-ref --short HEAD
> git rev-parse <branch>
> git rev-parse --symbolic-full-name <branch>@{u}
> git rev-list --left-right <branch>...refs/remotes/origin/<branch>
> git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname)
> git remote --verbose
> git config --get commit.template
> git show --textconv :<repo>/includes/api.php
> git show --textconv :<repo>/includes/messages.php
> git ls-files --stage -- \\<host>\anrdaemon\Documents\<repo>\<path>\includes\api.php
> git ls-files --stage -- \\<HOST>\anrdaemon\Documents\<repo>\<path>\includes\messages.php
> git cat-file -s af6c2b3341881bf4eb845cd08d1001c6d8414de7
> git cat-file -s db7cda155b5a8180b600615c0a882ceffa108ab7

@AnrDaemon
Copy link
Author

Do you need any more information?

@AnrDaemon
Copy link
Author

Still an issue with 1.55.1

@AnrDaemon
Copy link
Author

This is REALLY annoying. Running two git scans in parallel over the same network share is highly taxing on network throughput.
Especially considering that remote system is connected over WiFi.

@eamodio
Copy link
Contributor

eamodio commented Apr 14, 2021

What is the output of git rev-parse --git-dir?

@AnrDaemon
Copy link
Author

Depends, where in the tree you call it. In the repository root directory it's just .git.
In any subdirectory - //<HOST>/anrdaemon/Documents/<repo>/.git.

I suppose, that explains it. Given relative path (.git) VS Code prepends it with workspace directory. Which is, unsurprisingly, has a lowercased <host>.

git version 2.30.1.windows.1

@AnrDaemon
Copy link
Author

AnrDaemon commented Jun 1, 2021

Any news? I've tried to move workspace directory a level below project root, but that did not help either.

@AnrDaemon
Copy link
Author

I think I understand what's going on.
I noticed that in Explorer panel, some workspace files are shown with relative path (and show uppercase host when hovered), and some open with absolute path with host part shown lowercased.
The files can be opened from different sources (active debugger being a ready one), and VS Code must normalize paths at all times and try to match files to the workspace first. Else… stuff happens.

@AnrDaemon
Copy link
Author

AnrDaemon commented Aug 10, 2021

Simple reproduction:

  1. Install https://github.com/bmewburn/vscode-intelephense/releases/tag/v1.7.1
  2. Open workspace from an UNC path.
  3. Open file src\Wrappers\PDOMysql.php.
  4. From class declaration, position to parent class (PDOWrapper) and call "Go to definition".
  5. Check the open files. PDOWrapper.php is opened from a path that appears to be outside the ${workspaceFolder}
    image
  6. This immediately causes a second Git repository to be opened on the VCS panel. And other issues, like mentioned Breakpoints set offline never reached xdebug/vscode-php-debug#320.

@lszomoru lszomoru assigned lszomoru and unassigned eamodio Oct 4, 2021
@AnrDaemon
Copy link
Author

If any more information is needed, please ask.

@lszomoru lszomoru removed the info-needed Issue requires more information from poster label Jan 4, 2022
@AnrDaemon
Copy link
Author

And today it again created a new workspace for existing project.

\f0fbfcd256df0491… file://hosting64.darkdragon.lan/wwwroot/ccenter 228a505f 2022-01-19
\15d47c17de344125… file://hosting64.darkdragon.lan/wwwroot/ccenter 228a505f 2022-06-12

workspace.json is exactly identical in both workspaces. The hash is CRC32 of the workspace path. As you can see, it is identical, so no hidden symbols or anything.

@mkanet
Copy link

mkanet commented Oct 26, 2022

I have this issue too. Each time I close the duplicate repository, it gets added again later on.

@ozdeadmeat
Copy link

Is there a fix for this because it's fucking annoying

@lszomoru
Copy link
Member

Is anyone still able to reproduce this with the latest version of VS Code as over time we have made improvements in this area? Thanks!

@lszomoru lszomoru added the info-needed Issue requires more information from poster label Dec 12, 2023
@VSCodeTriageBot
Copy link
Collaborator

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@VSCodeTriageBot VSCodeTriageBot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2023
@AnrDaemon
Copy link
Author

Poke-poke.
Note the window title. This is really NOT useful to work with.
image
image

@lszomoru lszomoru reopened this May 29, 2024
@lszomoru lszomoru removed the info-needed Issue requires more information from poster label May 29, 2024
@lszomoru
Copy link
Member

@AnrDaemon, could you please share the contents of the git output window? Thanks!

@AnrDaemon
Copy link
Author

I did that on multiple occasions. What you are looking for in particular?

@lszomoru
Copy link
Member

I did that on multiple occasions. What you are looking for in particular?

I am not seeing that information in any of the comments on this issue. What I would like to understand is how does VS Code discover the repositories and why are there two instances of the same repository.

@AnrDaemon
Copy link
Author

Here: #112231 (comment)

If you tell me how to get it to log to a file, it would be more useful.

@AnrDaemon
Copy link
Author

Also #112231 (comment)

@AnrDaemon
Copy link
Author

Internet suggests git rev-parse --absolute-git-dir instead of git rev-parse --git-dir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues
Projects
None yet
Development

No branches or pull requests

8 participants
@eamodio @mkanet @lszomoru @AnrDaemon @ozdeadmeat @aiday-mar @VSCodeTriageBot and others