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
9.01k stars 1.34k forks source link

`gitlens.remotes` no longer takes effect when defined in project's `.vscode/settings.json` file #2760

Open sjdemartini opened 1 year ago

sjdemartini commented 1 year ago

Description

  1. With GitLens version v2023.6.2005
  2. With a .vscode/settings.json file that defines the "gitlens.remotes" field, like:
    "gitlens.remotes": [
      {
        "domain": "my.custom.example.com",
        "type": "GitLab"
      }
    ],

Historically, this was sufficient (for the past couple years or so), and the remote would take effect for the whole project. Now, it seems I need to separately define this setting instead/externally in my own .code-workspace workspace settings file in order for it to take effect. (That's rather inconvenient for our shared project where all developers should benefit from the same remote setup.) With the definition above only in the .vscode/settings.json, all remote-associated commands like GitLens: Copy Remote File URL, GitLens: Copy Remote Commit URL, etc. do not work:

image

Separately, clicking that See how to configure a custom remote provider... link goes to https://github.com/gitkraken/vscode-gitlens#remote-provider-integration-settings-, which is dead (the anchor no longer exists). There is no help about how to resolve.

Other GitLens behavior still works fine (I can view inline blame, look at file details, etc.).

GitLens Version

v2023.6.2005

VS Code Version

Version: 1.79.2 Commit: 695af097c7bd098fbf017ce3ac85e09bbc5dda06 Date: 2023-06-14T08:58:52.392Z (1 wk ago) Electron: 22.5.7 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Darwin x64 22.5.0

Git Version

git version 2.30.0

Logs, Screenshots, Screen Captures, etc

For what it's worth, I do see a single line in the GitLens output:

[2023-06-21 18:50:41.427] [GIT  ] [/Users/sdemartini/vscode_workspaces] git rev-parse --show-toplevel • Command failed: /usr/local/bin/git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel • not a git repository (or any of the parent directories): .git [54ms]

I have my foo.code-workspace file in the /Users/sdemartini/vscode_workspaces directory, which is not where the actual repo is (the folders for the workspace point to a different path), but this seems likely to be unrelated.

d13 commented 1 year ago

@sjdemartini @DanaGoyette We'll get that link update, thanks! The correct link is: https://help.gitkraken.com/gitlens/gitlens-settings/#remote-provider-integration-settings

sgarcia-dev commented 5 months ago

Experiencing this same issue, correctly configured gitlens.remotes in both my workspace config file, project, and user config file, and still getting that no auto-detected or configured remote providers found warning when I try to view a file on the remote.

Worse part is Gitlens is working properly beyond that, since the Gitlens remote view looks and browses fine, and that the couple of bug reports I found via google from 2021 and 2022 were all closed when the issue still happens. Guessing since its June 2024, this might not ever be fixed?

koenieee commented 4 months ago

Same issue here, please fix it. Looked for a day through all the issues, I can't get it to work.

ahammer-sc commented 3 months ago

Also came here to say I am experiencing this issue. went through several different attempts to get it to work. it was working before but now just stopped working.

lmao12 commented 3 months ago

I was able to get this working. I ran $ git remote -vv to see what my git path was. Based on that, I set this code in my ~/Library/Application Support/Code/User/settings.json file:

    "gitlens.remotes": [
        {
            "regex": "git@(.+):(.+).git",
            "type": "GitHub",
        }
    ]

The captured snippets inside both (.+) combined to make my Github URL (i.e. "github.my-company.com/repo") so you may need to play around with the regex.

I did NOT need the additional "gitlens.integrations.enabled": true option.

Actticus commented 2 months ago

Any updates here? Copy Remote File URL still didnt work with 'domain' setting

andrew-hardin commented 1 week ago

This is working for me on GitLens v13.6.0 after following the examples in the docs. However, the instructions are missing a critical step: restart VSCode after adding the remote.