Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with BitBucket Server #264

Open
cjoecker opened this issue Nov 16, 2022 · 3 comments
Open

Not working with BitBucket Server #264

cjoecker opened this issue Nov 16, 2022 · 3 comments

Comments

@cjoecker
Copy link

Hi,
The URLs I'm getting for Bitbucket Server are not correct in my case.

Correct URL:
https://my-url.com/stash/projects/evr/repos/repo-name/browse/README.md

Wrong URL generated by Gitlink:
https://my-url.com/projects/evr/repos/repo-name/browse/README.md

Remote URL:
ssh://[email protected]:1234/evr/repo-name.git

The part /stash is added to the online URL.

As a possible solution would be, to allow to adapt the base-URL on the settings of the plugin.
Some input box where I can write https://my-url.com/stash/

@marbon87
Copy link

marbon87 commented Feb 21, 2023

I have the same problem. A workaround is to configure a custom plattform based on the templates in

fun bitbucketServer(): UrlTemplates {
return UrlTemplates(
"{remote:url:protocol}://{remote:url:host}/projects/{remote:url:path:0}/repos/{remote:url:path:1}/browse/{file:path}/{file:name}?at=refs/heads/{branch}{line-block:start}#{line:start}-{line:end}{line-block:end}",
"{remote:url:protocol}://{remote:url:host}/projects/{remote:url:path:0}/repos/{remote:url:path:1}/browse/{file:path}/{file:name}?at={commit}{line-block:start}#{line:start}-{line:end}{line-block:end}",
"{remote:url:protocol}://{remote:url:host}/projects/{remote:url:path:0}/repos/{remote:url:path:1}/commits/{commit}"
)
}

and register your private domain for the custom plattform in Domain Registry

@cjoecker
Copy link
Author

@marbon87 thanks for the hint! I would still prefer it to be fixed since that’s a lot of work

@eXpl0it3r
Copy link

I adjusted them as following:

{remote:url:protocol}://{remote:url:host}/projects/{remote:url:path:1}/repos/{remote:url:path:2}/browse/{file:path}/{file:name}?at=refs/heads/{branch}{line-block:start}#{line:start}-{line:end}{line-block:end}
{remote:url:protocol}://{remote:url:host}/projects/{remote:url:path:1}/repos/{remote:url:path:2}/browse/{file:path}/{file:name}?at={commit}{line-block:start}#{line:start}-{line:end}{line-block:end}
{remote:url:protocol}://{remote:url:host}/projects/{remote:url:path:1}/repos/{remote:url:path:2}/commits/{commit}

As the remote was more like https://bitbucket.example.com/scm/project/repo.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants