gitkraken / vscode-gitlens

Supercharge Git inside VS Code and unlock untapped knowledge within each repository — Visualize code authorship at a glance via Git blame annotations and CodeLens, seamlessly navigate and explore Git repositories, gain valuable insights via rich visualizations and powerful comparison commands, and so much more
http://gitkraken.com/gitlens
Other
8.97k stars 1.32k forks source link

GitLens still not working properly with some symlinks since GitLens 12 #2063

Open sjahangir1 opened 2 years ago

sjahangir1 commented 2 years ago

I have had to downgrade to version 11.7.0 to get everything working again.

Steps to Reproduce:

  1. Simply run VS code and open a file. There is no line blame and no status bar indicators.
d13 commented 2 years ago

Can you please enable debug logging by running from GitLens: Enable Debug Logging from the Command Palette (F1 or ctrl/cmd+shift+p). This will enable logging to the GitLens and GitLens (Git) channel in the Output pane.

Once enabled, please reproduce the issue, and attach the log from the both GitLens and GitLens (Git) channels.

sjahangir1 commented 2 years ago

I have attached both log files below

GitLens (Git) Output.txt GitLens Output.txt .

dougiemooney commented 2 years ago

Same behaviour - downgrade to version 11.7.0 to return functionality

Issue observed with: GitLens Version: 12.1.1 Git Version: 2.31.1.windows.1 VSCode Version: 1.69.0-insider OS Name: Microsoft Windows 10 Enterprise OS Version: 10.0.19042 Build 19042

eamodio commented 2 years ago

@sjahangir1 I'm not sure exactly what is going on here but it is clearly related to symlinks. Can you please provide details as to the folder structure of your repo and the symlinks, and exactly the path you are opening in VS Code? Thanks!

@dougiemooney are you using symlinks as well? If so can you please attach logs too -- as well as the same information as above? If not, can you open a new issue with logs? Thanks!

sjahangir1 commented 2 years ago

@eamodio So currently my folder structure is like this:

-C L development L sources L projects L (source code folders)

However, the "development" folder is mapped to a virtual drive on my machine for easy access. So instead of going to C:\development\sources\projects(project source code folder), I am opening the project from Q:\sources\projects(project source code folder).

github-actions[bot] commented 2 years ago

This issue needs more information and has not had recent activity. Please provide the missing information or it will be closed in 7 days. Thanks!

vicenter-gitkraken commented 2 years ago

Issue with Gitlens when using relative paths: Steps to reproduce:

  1. Create a folder symlink /home/user/project that points to /storage/projects/~company/actual-project
  2. Open /home/user/project via ssh on vscode
  3. Gitlens errors out:
    Function._handleError
    EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat '/storage/projects/~company/actual-project/home/user/project/file.ext'

Attached are the logs after enabling debug login. In my case, the real mounted path is /mnt/ssd_old/ , however, I open the project using /mnt/ssd/ which is a symlink to /mnt/ssd_old/

For some reason, gitlens resolves the repoPath and file path differently and then tries to do a path replacement that ends up with a relative path that never exists. log (1).txt

schnoberts1 commented 1 month ago

I have the same issue as well. My source tree looks a bit like this:

root/
            cpu-a/
                          app/
                          shared/ --> symlink to ../../shared
            cpu-b/
                          app/
                          shared/ --> symlink to ../../shared
            shared/                          

Since the compile flags for cpu-a and cpu-b are different they are different CMake projects so I can't open the whole root in VSCode, instead I open cpu-a or cpu-b. In this scenario git lens cannot produce a blame for files in cpu-a/shared.

The git repo is a mono repo so .git exists at the root/ level.