Issue Type: Bug
When using any of the "Open file on remote" options, the wrong URL is used to our Bitbucket server.
The browser opens to a URL like:
https://internal.company.com/projects/bitbucket/repos/scm/ncp/study-design-service
However, our actual URL would be something like:
https://internal.company.com/bitbucket/projects/NCP/repos/study-design-service/browse
How does the extension determine this URL?
Extension version: 11.0.2
VS Code version: Code 1.51.1 (e5a624b788d92b8d34d1392e4c4d9789406efe8f, 2020-11-10T23:34:32.027Z)
OS version: Windows_NT x64 10.0.19042
Bitbucket version: 7.5.1
System Info
|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz (12 x 2592)|
|GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled|
|Load (avg)|undefined|
|Memory (System)|31.75GB (16.60GB free)|
|Process Argv|--folder-uri file:///c%3A/Code/ncp/study-design-service --crash-reporter-id 94973ead-12e5-4b7d-b033-6d97d3464d2b|
|Screen Reader|no|
|VM|0%|
It appears like part of the problem is that something is misinterpreting my $repoBase variable.
The http link to our git repo would be something like:
https://internal.company.com/bitbucket/scm/ncp/study-design-service.git
The /scm portion gets included in $repoBase but that is not part of the path to the web interface URL to Bitbucket. Is there any way to control how this is parsed from the git URL?
You might try playing with the gitlens.remotes setting to have more control over the URL - https://github.com/eamodio/vscode-gitlens#custom-remotes-settings
The bitbucket-server remote config seems to assume a different URL pattern than what you need:
@mgallagher, it isn't possible to do what you suggest because gitlens misinterprets the git address when coming up with the available variables for custom remotes. Things like ${repoBase} are incorrect. You cannot resolve the problem with custom remotes if the component parts provided by gitlens are wrong.
What I'm seeing is that this is already called out in another ticket and is due to gitlens misinterpreting a git address that has a context base.
Could someone provide a PR here? I don't have a Bitbucket server to test with.
Experiencing a similar issue, the remote file url returned is encoding / as %2F from baseURL onwards... replacing the encoded chars yields a right url...
Can you please try this in the GitLens insiders edition? As I've fixed encoding issues there. Be sure to disable/uninstall the stable version of GitLens first.
You can install the insiders edition from here.
Nice, it worked, thanks :)
Most helpful comment
Can you please try this in the GitLens insiders edition? As I've fixed encoding issues there. Be sure to disable/uninstall the stable version of GitLens first.
You can install the insiders edition from here.