Vscode-gitlens: Can't load any GitLens features or UI

Created on 15 Aug 2018  Â·  19Comments  Â·  Source: eamodio/vscode-gitlens

So I've just installed GitLens but can't get any of the features or UI to activate. I've tried restarting VSCode and this has had no effect.

My workspace is in a sub-directory of the repo root. My workspace is at MyProject/FeatureTests/ and the repo root as at MyProject/. It appears GitLens can't find the repo because it doesn't search upwards only downwards. Code's own Git features work and can see the repo just fine.

  • GitLens Version: v8.5.4
  • VSCode Version: 1.26.0
  • OS Version: macOS High Sierra 10.13.6

Steps to Reproduce:

  1. Open workspace
  2. Attempt to activate any GitLens features.
  3. View verbose logs, see errors.

Logs

Git found: 2.15.1 @ /usr/local/Cellar/git in 55 ms
Starting repository search in 1 folders
Searching for repositories (depth=0) in '/Users/joe_bloggs/Source/MyProject/FeatureTests' ...
Running(/Users/joe_bloggs/Source/MyProject/FeatureTests): git rev-parse --show-toplevel
GitLens(v8.5.4) activated in 103 ms
FAILED(/Users/joe_bloggs/Source/MyProject/FeatureTests): git rev-parse --show-toplevel FAILED in 19 ms
Searching for repositories (depth=0) in '/Users/joe_bloggs/Source/MyProject/FeatureTests' took 19 ms
Running(/Users/joe_bloggs/Source/MyProject/FeatureTests/.vscode): git rev-parse --show-toplevel
Awaiting(/Users/joe_bloggs/Source/MyProject/FeatureTests/.vscode): git rev-parse --show-toplevel
FAILED(/Users/joe_bloggs/Source/MyProject/FeatureTests/.vscode): git rev-parse --show-toplevel FAILED in 7 ms
FAILED(/Users/joe_bloggs/Source/MyProject/FeatureTests/.vscode): git rev-parse --show-toplevel FAILED in 1 ms
isTracked('/Users/joe_bloggs/Source/MyProject/FeatureTests/.vscode/settings.json', 'undefined')
Running(): git ls-files /Users/joe_bloggs/Source/MyProject/FeatureTests/.vscode/settings.json
FAILED(): git ls-files /Users/joe_bloggs/Source/MyProject/FeatureTests/.vscode/settings.json FAILED in 5 ms
isTracked('/Users/joe_bloggs/Source/MyProject/FeatureTests/.vscode/settings.json', 'undefined') = false
bug

Most helpful comment

Sweet! I'll get a new version out tonight with the fix -- thank you for the help!

All 19 comments

GitLens doesn't need to search upwards in the same way as downward, since git can provide that information directly (using git rev-parse --show-toplevel). But for some reason that seems to be failing.

Can you try running git rev-parse --show-toplevel from inside the /Users/joe_bloggs/Source/MyProject/FeatureTests folder? Also is the casing of that path correct?

I’m out at the moment but I did try that and it showed the repo correctly.
On Thu, 16 Aug 2018 at 05:56, Eric Amodio notifications@github.com wrote:

GitLens doesn't need to search upwards in the same way as downward, since
git can provide that information directly (using git rev-parse
--show-toplevel). But for some reason that seems to be failing.

Can you try running git rev-parse --show-toplevel from inside the
/Users/joe_bloggs/Source/MyProject/FeatureTests folder? Also is the
casing of that path correct?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/eamodio/vscode-gitlens/issues/477#issuecomment-413425953,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAmfSdijBF-1fhGU7z-QHs5c4ZUT0dQaks5uRPuQgaJpZM4V-GSp
.

@eamodio I've ran that command and got the following:

/Users/joe_bloggs/Source/MyProject

I notice in the head of the Gitlens logs:

Git found: 2.15.1 @ /usr/local/Cellar/git in 55 ms
Starting repository search in 1 folders
Searching for repositories (depth=0) in '/Users/joe_bloggs/Source/MyProject/FeatureTests' ...
Running(/Users/joe_bloggs/Source/MyProject/FeatureTests): git rev-parse --show-toplevel
GitLens(v8.5.4) activated in 103 ms

That it executes that command to find the repo root, and then the next message is GitLens(v8.5.4) activated in 103 ms is that saying that Gitlens has found the repo and activation or does the activation happen regardless? As the following messages after the activation message are recursive searching of the repo.

Hrm, and if you run git --version on the command line do you see the same version as in your log?

The activation log message just marks the end of GitLens searching for repositories.

Can set gitlens.outputLevel to debug, and then post the output from the GitLens (Git) channel? It should hopefully provide more details.

Hrm, and if you run git --version on the command line do you see the same version as in your log?

Yes Git version 2.15.1.

Debug output seems the same when outputLevel set to debug:

Git found: 2.15.1 @ /usr/local/Cellar/git in 47 ms
Starting repository search in 1 folders
Searching for repositories (depth=0) in '/Users/joe_bloggs/Source/MyProject/FeatureTests' ...
Running(/Users/joe_bloggs/Source/MyProject/FeatureTests): git rev-parse --show-toplevel
GitLens(v8.5.4) activated in 90 ms
FAILED(/Users/joe_bloggs/Source/MyProject/FeatureTests): git rev-parse --show-toplevel FAILED in 29 ms
Searching for repositories (depth=0) in '/Users/joe_bloggs/Source/MyProject/FeatureTests' took 30 ms

It's worth noting the vscode workspace resides in a sub-directory of the repo root /Users/joe_bloggs/Source/MyProject/FeatureTests/.vscode while the .git directory sits in the repo root at /Users/joe_bloggs/Source/MyProject.

With it set to debug there should be 2 output channels, GitLens and GitLens (Git), can you post the output from GitLens (Git)?

Thanks for the tip, here is the output:

[2018-08-20 08:16:22:691] git rev-parse --show-toplevel FAILED in 24 ms (/Users/joe_bloggs/Source/MyProject/FeatureTests)

Error: spawn EACCES
[2018-08-20 08:16:22:763] git rev-parse --show-toplevel FAILED in 6 ms (/Users/joe_bloggs/Source/MyProject/FeatureTests/features)

Error: spawn EACCES
[2018-08-20 08:16:22:763] git rev-parse --show-toplevel FAILED in 2 ms (/Users/joe_bloggs/Source/MyProject/FeatureTests/features)

Error: spawn EACCES
[2018-08-20 08:16:22:769] git ls-files /Users/joe_bloggs/Source/MyProject/FeatureTests/features/search.feature FAILED in 4 ms ()

Error: spawn EACCES

If I run these commands above in the VSCode Terminal panel they work as expected. Also the output from VSCode Git logs is:

Looking for git in: /usr/local/bin/git
Using git 2.15.1 from /usr/local/bin/git
> git rev-parse --show-toplevel
> git config --get commit.template
Open repository: /Users/joe_bloggs/Source/MyProject

Which I believe is doing exactly the same thing your extension is doing and is working and finding the repo.

Ok I've fixed it by adding the following to my settings:

"gitlens.advanced.git": "/usr/local/bin/git"

Essentially telling Gitlens to use the same Git executable as VSCode. I'm not sure why it wouldn't do that by default, to be honest. So might be a bug there but this workaround works for me.

Thanks for your help on this.

@cameroncooke I think I know why this isn't working. GitLens does try to get the git path from vscode, but it wasn't apparently waiting correctly if the Git extension hadn't loaded yet (which never seemed to happen in the past, but is now). I've got a fix for that -- can you try out this private build? Remove the .zip from the filename and you can install it. If you need instructions see here

gitlens-8.5.5.vsix.zip

@eamodio I've removed the gitlens.advanced.git option, verified that the release version failed again, then installed the private build.

I can report the private version does indeed fix the issue and everything now works without having to explicitly define the git path. 🎉

Sweet! I'll get a new version out tonight with the fix -- thank you for the help!

@eamodio I had a similar issue. Gitlens was not found, the pre-release worked.

Error still persists, getting spawn EACCESS

@yashLadha Can you open a new issue with more details and logs about what you are experiencing? From EACCESS is sounds like a possible permissions issue.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings