Git: Support opening repositories on symlinked paths
- VSCode Version: 1.0.0 (1.0.0)
- OS Version: OSX 10.11.4 (15E65)
Steps to Reproduce:
- Create a new project with git repository initialised.
- Create a folder /foo/bar
- Add a symlink from /foo/bar to /bar
ln -s /foo/bar . - Go to Git tab on vscode, and stage
/barfolder.
If now you click on staged /bar folder, you'll get an error Warn: Can't open this git resource.
It would be nice to find nested git repos as well. Some of us are fortunate enough to not code on Monoliths.
It would be nice to have an option to NOT do GIT change tracking inside symlinks. If my symlink is to another folder in the same git repo I don't want the changed files showing up twice in Code's Git view.
This issue is about displaying symlinks in the git view and what happens when you click them. Neither Code nor git follow (or should follow) the symlinks.
Ok, off topic, but I am seeing VScode following symlinks in the git view. Running "git status" does not show these files. Should I create a new issue or discuss this somewhere else?
Can you take a screenshot to show me what you mean?
I know what causes it. The git repo is a remotely mounted fuse file system. The linux terminal shows permissions and symlinks properly, but for some reason vscode isn't. If I create a simple git repo with a directory and a symlink to that directly it works properly on my local filesystem. If I move that to the fuse mounted file system it confuses vscode.
Here's my mount command: sshfs hostname:/home/user/ /home/user/ -o sshfs_sync -o sync_readdir -o follow_symlinks -o kernel_cache -o max_background=50 -o big_writes
Actually, no more errors when you click it. We handle it nicely, even with decorations.
We just can't handle the root being a symlink in itself.
Staging ranges of a file opened through a symlink is broken as well, and will lead to weird behavior where instead the file that is the symlink has the selected range staged and every other line from the target is displayed as changes in the symlink file in the git side bar.
This issue, specifically git gutters not displaying but maybe others as well, also occurs for remote symlinked git repos using the Remote - SSH extension.
Can confirm, no Git gutter's when using a symlinked path in Remote WSL (Though other Git features seem to work fine) But if I navigate to the same path using /mnt/c and start up "code ." it all works fine.
is the issue with the Remote SSH extension (and thus bugs/work should be tracked there) or with vscode itself?
Same issue here when working on a linked folder. If a open the target folder, it works. If a open the symbolic link 'folder', gutter annotations won´t work.
Is there a way to recognize this from the extension, and perhaps provide an error in some log (like the VSCode "Show Git Output" log)? I don't know the internals work of these extensions work, but it took me a lot of Googling to find this error – the keyword I was missing was "gutter".
I am facing the same issue when using RemoteSSH for VSCode. Git gutter works on files with full path but doesn't work on same when opened with relative path.
Is there a solution for this problem?
Open the non-symlinked path worked for me, but I had the same issue Feb 26, 2020.
Yeah, this is pretty terrible. I've used all sorts of other OS-level hacks to get around this issue.
Yeah, this is pretty terrible. I've used all sorts of other OS-level hacks to get around this issue.
Do you mind sharing what you did to work around the issue?
I navigated directly through /mnt/c/... I had the project symlinked from $HOME/project. Just needed to use an absolute path from root.
I have a very similar issue, a $HOME folder built on login as symlink to a folder in /mnt/home. If I open my project with the path containing $HOME, all the Git decorations are missing. If I open the same project with the real path that uses /mnt/home, then the Git decorations appear as normally.