Vscode-gitlens: Can't activate any GitLens UI

Created on 23 Feb 2018  Â·  36Comments  Â·  Source: eamodio/vscode-gitlens

  • GitLens Version: 8.0.2
  • VSCode Version: 1.20.1
  • OS Version: 10.12.6

Steps to Reproduce:

  1. Installed GitLens
  2. Opened Welcome Screen
    all activated but nothing shown in UI
  3. Restarted VSCode
    still nothing
  4. set following settings manually (still no UI Elements or any sign of GitLens beside the Welcome Screen)
    "gitlens.gitExplorer.enabled": true,
    "gitlens.statusBar.enabled": true,
    "gitlens.currentLine.enabled": true,
    "gitlens.hovers.annotations.enabled": true,
    "gitlens.codeLens.enabled": true

As a side note, I have a Case Sensitive File System

I even re-installed VSCode and disabled ALL Extensions, but still there is NO Sign of GitLens.

needs more info

Most helpful comment

I was able to solve this issue on my machine by setting git.path in VSCode. I have git installed using Homebrew and once I set the git.path to /usr/local/Cellar/git/2.16.2/bin/git everything started working as expected.

  • OSX: 10.13.3
  • VSCode: 1.22.0-insider
  • GitLens: 8.2.0
  • git: 2.16.2

All 36 comments

Hi, can you please enable output channel logging by setting "gitlens.outputLevel": "verbose" in your settings.json. This will enable logging to the GitLens channel in the Output pane. Once enabled, please attempt to reproduce the issue (if possible) and attach the relevant log lines from the GitLens channel.

Git found: 2.13.2 @ /usr/local/Cellar/git in 64 ms
Starting repository search in 1 folders
Searching for repositories (depth=1) in '/Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt' ...
Running(/Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt): git rev-parse --show-toplevel
GitLens(v8.0.2) activated in 137 ms
Completed(/Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt): git rev-parse --show-toplevel in 33 ms
Running(/Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt): git rev-parse --show-toplevel
Completed(/Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt): git rev-parse --show-toplevel in 5 ms
Searching for repositories (depth=1) in '/Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt' took 204 ms
Running(/Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt): git rev-parse --show-toplevel
Completed(/Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt): git rev-parse --show-toplevel in 7 ms
isTracked('/Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt/package.json', 'undefined', 'undefined')
Running(): git ls-files /Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt/package.json
Completed(): git ls-files /Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt/package.json in 6 ms
Running(/Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt/server): git rev-parse --show-toplevel
Completed(/Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt/server): git rev-parse --show-toplevel in 7 ms
isTracked('/Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt/server/index.js', 'undefined', 'undefined')
Running(): git ls-files /Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt/server/index.js
Completed(): git ls-files /Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt/server/index.js in 4 ms

grafik
grafik

by the way, updated git 2.13 to 2.16 bit didn't help

What folder are you opening in vscode? Does that folder have a repository in it? If so, is the repo at the root? Nested deeper than 1 level?

@eamodio there is a valid repo without any nasting:
grafik

I had two remotes linked to that repo but this is not the issue as it does not work on any of my repos.

So which folder are you opening vscode to? /Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt?

And the repo is in /Users/Greg/Projekte/HumanConnection/hc-frontend-nuxt/stuff?

@eamodio Wow I know what caused it, I had Git installed be Homebrew on OS X!
Could it be that you are expecting the git executable in a specific directory like /usr/local/bin/git.

Before it was /usr/local/Cellar/git

GitLens does search for the git executable (similar to what vscode does). You can also use the built-in vscode setting git.path to point to the correct git exe (FYI, GitLens also has its own gitlens.advanced.git but that should only be used if for some strange reason it has to be separate).

It seems very strange to me that vscode built-in git support would work, but GitLens wouldn't.

What is strange is that there is no message or anything, just the vacuum void filled with nothing.

Well that part isn't surprising -- from the first logs you posted, GitLens initialized fine, found git fine, and used git fine, but it failed to find any repositories. Which is not an uncommon scenario -- people open folders and files without repos all the time, so in that case GitLens just silently hides in the background until something changes (i.e. a repo shows up).

And I'm even more confused that changing the git path would have any affect on any of that (because the version of git it found wasn't that old -- if it was you would have seen a warning about it).

So the crux of the issue is why is GitLens not finding a repo in the folder you opened. That is why I was asking about what folder you are opening and exactly where the repo is inside that folder. By default GitLens only scans 2 levels -- the folder opened and 1 level down from there (it can be controlled with the gitlens.advanced.repositorySearchDepth setting -- the trade off being the deeper it goes the longer it takes). But GitLens should automatically "find" a repo, when you open a file from within a repo (assuming that is all within the folder you opened in vscode).

So can you confirm what folder you are opening, and where the repo is located?

@appinteractive any update on this?

hey @eamodio I dod not did alter any git specific settings before and the .git folder is direclty in the root of the opened project folder. Also is there no git related stuff in any of the parend or child directories. It did checked it with several projects before.

It seams as if it was not setisfied with the given git version is found or did not even was aware of the git installation provided in the path variables.

Could it be that you rely somehow on the build in terminal / bash instead of the one that vscode is using? Because I am using iTerm with ZSH (which I also see in vscode) where the path was set, but the build in terminal may not have the variable as they use different profile files.

I'm encountering a similar issue. I installed GitLens three weeks ago but it stopped functioning entirely after about a week and a half. I've tried enabling, disabling, and reinstalling it and every other extension to rule out any conflicts, but saw no change.

  • OSX 10.13.3
  • VSCode 1.20.1
  • GitLens 8.1.1
  • git 2.16.2

I enabled the verbose output setting, and see this output when opening any file:
Running(/Users/d.kershaw/repositories/mojo/app/controllers): git rev-parse --show-toplevel Completed(/Users/d.kershaw/repositories/mojo/app/controllers): git rev-parse --show-toplevel in 3 ms isTracked('/Users/d.kershaw/repositories/mojo/app/controllers/application_controller.rb', 'undefined', 'undefined') Running(): git ls-files /Users/d.kershaw/repositories/mojo/app/controllers/application_controller.rb Completed(): git ls-files /Users/d.kershaw/repositories/mojo/app/controllers/application_controller.rb in 3 ms

Me, neither.

  • OSX : 10.13.3
  • VSCode : 1.21.1
  • GitLens : 8.2.0
  • git : 2.14.3

logs:Gitlens

Running(/Users/RakkMac/Workspace/deep-learning-from-scratch/.vscode): git rev-parse --show-toplevel
Completed(/Users/RakkMac/Workspace/deep-learning-from-scratch/.vscode): git rev-parse --show-toplevel in 8 ms
isTracked('/Users/RakkMac/Workspace/deep-learning-from-scratch/.vscode/settings.json', 'undefined', 'undefined')
Running(): git ls-files /Users/RakkMac/Workspace/deep-learning-from-scratch/.vscode/settings.json
Completed(): git ls-files /Users/RakkMac/Workspace/deep-learning-from-scratch/.vscode/settings.json in 5 ms
Running(/Users/RakkMac/Library/Application Support/Code/User): git rev-parse --show-toplevel
Completed(/Users/RakkMac/Library/Application Support/Code/User): git rev-parse --show-toplevel in 8 ms
isTracked('/Users/RakkMac/Library/Application Support/Code/User/settings.json', 'undefined', 'undefined')
Running(/Users/RakkMac/Workspace/deep-learning-from-scratch/.vscode): git rev-parse --show-toplevel
Completed(/Users/RakkMac/Workspace/deep-learning-from-scratch/.vscode): git rev-parse --show-toplevel in 5 ms
isTracked('/Users/RakkMac/Workspace/deep-learning-from-scratch/.vscode/settings.json', 'undefined', 'undefined')

Help me, plz!

I was able to solve this issue on my machine by setting git.path in VSCode. I have git installed using Homebrew and once I set the git.path to /usr/local/Cellar/git/2.16.2/bin/git everything started working as expected.

  • OSX: 10.13.3
  • VSCode: 1.22.0-insider
  • GitLens: 8.2.0
  • git: 2.16.2

@ninnemana Thank you savior!

It's solved with setting git.path!

Actually, I have legacy git with newest one, like /usr/bin/git, /usr/local/git/bin/git. I just put git.path: "/usr/bin/git" on settings.json, then it worked!

Happy working day!

@ninnemana @Rakk4403 were git operations in vscode (not GitLens) also failing?

@ninnemana worked for me as well!

@eamodio git operations were working fine for me before and after the fix.

@dylankershaw so using git from vscode worked fine, but GitLens failed?

Yes, correct.

On Apr 6, 2018, at 12:10 AM, Eric Amodio notifications@github.com wrote:

@dylankershaw so using git from vscode worked fine, but GitLens failed?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@eamodio Yes, git operation was fine.

problems are,

  • non-displayed gitlens section on Explore tab.
  • gitlens: welcome, gitlens: open settings are the only commands on Command Pallete

Since https://github.com/eamodio/vscode-gitlens/issues/295#issuecomment-377961163 "fixed" the issue for all of you I'm going to close this. Please feel free to re-open if it comes back.

@eamodio I got the same problem as @Rakk4403, change git.path does not solve the problem.

I have no idea how this can happen. I try many ways, change git.path, I even uninstall everything, remove extensions in ~/.vscode/extensions, and install gitlens first but it does not work. Moreover, there is no message about any error or something :( I just love gitlens and now I don't know what to do more to make it works :(

I had the same problem, removing a missing folder from my workspace solved it.

What do you mean by removing a missing folder? Could there have been permission issues on that folder?

I set in my *.code-workspace file a folder that did not exist (because I deleted it). GitLens' UI did not appear until I removed the setting relative to that folder from the workspace, after which it worked normally.

@voppe THANK YOU! That info helped me discover a lurking problem with how GitLens searches for repos. Any missing folder, invalid permissions on a folder, or any other error during that search, GitLens dies. This will be fixed ASAP.

Thanks again!

Hi @eamodio,

I'm getting the same issue where GitLens is nowhere to be found, but my log is a bit different:

Git found: 2.17.1 @ /usr/local/bin/git in 82 ms
Starting repository search in 5 folders
Searching for repositories (depth=1) in '/Users/jeff/Development/SDVI/dev/src/butterfly' ...
Running(/Users/jeff/Development/SDVI/dev/src/butterfly): git rev-parse --show-toplevel
GitLens(v8.5.0) activated in 717 ms
Completed(/Users/jeff/Development/SDVI/dev/src/butterfly): git rev-parse --show-toplevel Completed in 782 ms
Repository found in '/Users/jeff/Development/SDVI/dev/src/butterfly'
Searching for repositories (depth=1) in '/Users/jeff/Development/SDVI/dev/src/butterfly' took 1736 ms
Searching for repositories (depth=1) in '/Users/jeff/Development/SDVI/dev/src/firefly' ...
Running(/Users/jeff/Development/SDVI/dev/src/firefly): git rev-parse --show-toplevel
Completed(/Users/jeff/Development/SDVI/dev/src/firefly): git rev-parse --show-toplevel Completed in 98 ms
Repository found in '/Users/jeff/Development/SDVI/dev/src/firefly'
Searching for repositories (depth=1) in '/Users/jeff/Development/SDVI/dev/src/firefly' took 297 ms
Searching for repositories (depth=1) in '/Users/jeff/Development/SDVI/dev/src/peacock' ...
Running(/Users/jeff/Development/SDVI/dev/src/peacock): git rev-parse --show-toplevel
Completed(/Users/jeff/Development/SDVI/dev/src/peacock): git rev-parse --show-toplevel Completed in 132 ms
Repository found in '/Users/jeff/Development/SDVI/dev/src/peacock'
Searching for repositories (depth=1) in '/Users/jeff/Development/SDVI/dev/src/peacock' took 344 ms
Searching for repositories (depth=1) in '/Users/jeff/Development/SDVI/dev/src/monkey' ...
Running(/Users/jeff/Development/SDVI/dev/src/monkey): git rev-parse --show-toplevel
Completed(/Users/jeff/Development/SDVI/dev/src/monkey): git rev-parse --show-toplevel Completed in 14 ms
Repository found in '/Users/jeff/Development/SDVI/dev/src/monkey'
Searching for repositories (depth=1) in '/Users/jeff/Development/SDVI/dev/src/monkey' took 24 ms
Searching for repositories (depth=1) in '/Users/jeff/Development/SDVI/dev/src/cli' ...
Running(/Users/jeff/Development/SDVI/dev/src/cli): git rev-parse --show-toplevel
Completed(/Users/jeff/Development/SDVI/dev/src/cli): git rev-parse --show-toplevel Completed in 7 ms
Repository found in '/Users/jeff/Development/SDVI/dev/src/cli'
Searching for repositories (depth=1) in '/Users/jeff/Development/SDVI/dev/src/cli' took 10 ms
getRemotesCore('/Users/jeff/Development/SDVI/dev/src/butterfly')
Running(/Users/jeff/Development/SDVI/dev/src/butterfly): git remote -v
Completed(/Users/jeff/Development/SDVI/dev/src/butterfly): git remote -v Completed in 18 ms
Running(/Users/jeff/Library/Application Support/Code - Insiders/User): git rev-parse --show-toplevel
FAILED(/Users/jeff/Library/Application Support/Code - Insiders/User): git rev-parse --show-toplevel FAILED in 7 ms
isTracked('/Users/jeff/Library/Application Support/Code - Insiders/User/settings.json', 'undefined')
Running(): git ls-files /Users/jeff/Library/Application Support/Code - Insiders/User/settings.json
FAILED(): git ls-files /Users/jeff/Library/Application Support/Code - Insiders/User/settings.json FAILED in 8 ms
isTracked('/Users/jeff/Library/Application Support/Code - Insiders/User/settings.json', 'undefined') = false

Any ideas? It looks like it's failing to run git rev-parse on my Code - Insiders/User folder, which I can confirm is not a git repository. I looked in my workspace file to see if I had any invalid directories listed in there like others have mentioned here, but I couldn't find any.

@jeffberry Those errors are normal/expected -- my guess is you have the settings.json file open, so GitLens tries to check the path of open files for repositories to provide features, but if there isn't one that is fine.

Are you opening a multi-root workspace with many folders? What is the behavior you are seeing (or not seeing)?

@eamodio Ah, that makes sense for those errors, you're correct in that it only triggers those when settings are open.

Yes, I have a workspace open that has 5 folders added to it, each of which is a git repository. GitLens has worked great for me up until about a week or two ago, and now I just don't see it anywhere; I don't get an icon in the side panel, nor do I have a "GitLens" portion on the SCM panel anymore. The only thing I can really see or access is the "Welcome" panel, even running "Toggle Git Code Lens" doesn't appear to do anything.

@jeffberry Do you see any errors in the console if you open up the developer tools? Can you provide a full trace of startup?

@eamodio I dug through the console and found a few errors, but they were related to an icon plugin I have installed. I uninstalled that plugin and the errors went away. While I was looking at the logs, I ended up noticing that I was in Zen mode, and the Gitlens icon does not appear in Zen mode. Disabling Zen mode got GitLens working again and I'm back in action.

Thanks for the quick help, and thanks for the great plugin!

Ah, awesome. Glad it is sorted. Now that you can have GitLens explorers in their own activity bar icon now, I probably should stop hiding them in Zen mode (at least only hide explorers that aren't in the GitLens view).

Thanks!

works on OSx, but doesnt work on Windows 7 for me :(

@steelx can you open a new issue for that with more details and ideally logs? The issue template walks through turning on logging.

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