vscode-gitlens icon indicating copy to clipboard operation
vscode-gitlens copied to clipboard

Add ${trackedBranch} variable for `gitlens.remotes.urls`

Open runofthemill opened this issue 1 year ago • 0 comments

Hello!

So I've got a configuration for a self-hosted GitLab instance that's behind a VPN, and it works great! Except it doesn't seem to have a way to deal w/ a branch who's name doesn't match the tracked branch :\

It would be great do be able to do something like:

  "gitlens.remotes": [
    {
      "name": "Example Gitlab",
      "protocol": "https",
      "regex": "ssh://git@(gitlab)/([^\\.]+)",
      "type": "Custom",
      "urls": {
        "branch": "https://gitlab.internal.example.com/${repo}/commits/${trackedBranch}", <-----
        "branches": "https://gitlab.internal.example.com/${repo}/branches",
        "commit": "https://gitlab.internal.example.com/${repo}/commit/${id}",
        "file": "https://gitlab.internal.example.com/${repo}?path=${file}${line}",
        "fileInBranch": "https://gitlab.internal.example.com/${repo}/blob/${trackedBranch}/${file}${line}", <-----
        "fileInCommit": "https://gitlab.internal.example.com/${repo}/blob/${id}/${file}${line}",
        "fileLine": "#L${line}",
        "fileRange": "#L${start}-${end}",
        "repository": "https://gitlab.internal.example.com/${repo}"
      }

Where trackedBranch is the name of the remote branch that the local branch is tracking.

Cheers :)

runofthemill avatar Aug 12 '24 18:08 runofthemill