Vscode-gitlens: Can't open remote on bitbucket

Created on 26 Mar 2019  路  6Comments  路  Source: eamodio/vscode-gitlens


  • GitLens Version: 9.5.1
  • VSCode Version: 1,32,3
  • OS Version: Windows 10

Steps to Reproduce:

  1. Connect to a Bitbucket repo, e.g.
git remote -v
origin  https://bitbucket.tds.td.com/scm/tbsm/tbsm-vision-db.git (fetch)
origin  https://bitbucket.tds.td.com/scm/tbsm/tbsm-vision-db.git (push)

2.
Click on :Open Branch On Remote

  1. 404 since the URL is incorrect
    (tries to go to https://bitbucket.tds.td.com/projects/scm/repos/tbsm/tbsm-vision-db/commits?until=develop)

Correct url is: https://bitbucket.tds.td.com/projects/TBSM/repos/tbsm-vision-db/commits

The problem is the "scm/" inserted in the bad url.

bug

Most helpful comment

Also having this issue with Bitbucket Server v5.16.0

scm appears in the git URL, however it is not used at all in formulating the url for browsers to visit. Even with the gitlens.remotes configuration, it is not possible to construct a dynamic URL that works for each of my repos, and I have to hardcode it per-project.

Example:

${repo}: scm/myproject/myrepo
${repoPath}: myproject/myrepo
${repoBase}: scm

An example URL I need is:
https://bitbucket.customurl.com/projects/myproject/repos/myrepo/commits/a1b2c3

h1. Solution

Ignore /scm when translating the remote names into browser-friendly URLs. Possibly could just add a replace call here, though probably we should find a way to more specifically scope it to BB Server.

All 6 comments

Also having this issue with Bitbucket Server v5.16.0

scm appears in the git URL, however it is not used at all in formulating the url for browsers to visit. Even with the gitlens.remotes configuration, it is not possible to construct a dynamic URL that works for each of my repos, and I have to hardcode it per-project.

Example:

${repo}: scm/myproject/myrepo
${repoPath}: myproject/myrepo
${repoBase}: scm

An example URL I need is:
https://bitbucket.customurl.com/projects/myproject/repos/myrepo/commits/a1b2c3

h1. Solution

Ignore /scm when translating the remote names into browser-friendly URLs. Possibly could just add a replace call here, though probably we should find a way to more specifically scope it to BB Server.

PR #767 submitted

When is the next release planned? I'm so tempted to hack a local copy version of the plugin just for this fix...

Most likely tonight or tomorrow night.

Most likely tonight or tomorrow night.

Excellent!

BTW, thank you for your work! It's appreciated!

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