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

Can't load any GitLens features or UI #477

Closed
cameroncooke opened this Issue Aug 15, 2018 · 16 comments

Comments

Projects
None yet
3 participants
@cameroncooke

cameroncooke commented Aug 15, 2018

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

@cameroncooke cameroncooke changed the title from dd to Can't load any GitLens features or UI Aug 15, 2018

@eamodio

This comment has been minimized.

Owner

eamodio commented Aug 16, 2018

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?

@cameroncooke

This comment has been minimized.

cameroncooke commented Aug 16, 2018

@cameroncooke

This comment has been minimized.

cameroncooke commented Aug 17, 2018

@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.

@eamodio

This comment has been minimized.

Owner

eamodio commented Aug 17, 2018

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.

@eamodio

This comment has been minimized.

Owner

eamodio commented Aug 17, 2018

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

@cameroncooke

This comment has been minimized.

cameroncooke commented Aug 17, 2018

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
@cameroncooke

This comment has been minimized.

cameroncooke commented Aug 17, 2018

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.

@eamodio

This comment has been minimized.

Owner

eamodio commented Aug 17, 2018

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

@cameroncooke

This comment has been minimized.

cameroncooke commented Aug 20, 2018

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
@cameroncooke

This comment has been minimized.

cameroncooke commented Aug 20, 2018

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.

@cameroncooke

This comment has been minimized.

cameroncooke commented Aug 20, 2018

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.

@cameroncooke

This comment has been minimized.

cameroncooke commented Aug 21, 2018

Thanks for your help on this.

@eamodio

This comment has been minimized.

Owner

eamodio commented Aug 21, 2018

@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

@cameroncooke

This comment has been minimized.

cameroncooke commented Aug 21, 2018

@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. 🎉

@eamodio

This comment has been minimized.

Owner

eamodio commented Aug 21, 2018

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

@eamodio eamodio reopened this Aug 21, 2018

@eamodio eamodio added bug and removed needs more info labels Aug 21, 2018

@eamodio eamodio self-assigned this Aug 21, 2018

@eamodio eamodio added this to the Soon™ milestone Aug 21, 2018

@eamodio eamodio closed this in 9f0199e Aug 22, 2018

@ItzhakS

This comment has been minimized.

ItzhakS commented Oct 16, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment