ben-gibson / GitLink

A Jetbrains plugin that opens a local file under Git version control in its remote host using the default browser.
https://plugins.jetbrains.com/plugin/8183-gitlink
MIT License
728 stars 59 forks source link

Azure DevOps Links not working #235

Closed StefanLobbenmeier closed 1 year ago

StefanLobbenmeier commented 2 years ago

I tried making this plugin work with our azure devops project, but it seems to generate the wrong urls: image

This is the url it generates: https://ssh.dev.azure.com/v3/companyname/companyname.de/companyname-client?version=GBbranchname&path=/README.md&line=1&lineEnd=1&lineStartColumn=1&lineEndColumn=1

That is the link I get manually when copying from Azure DevOps https://dev.azure.com/companyname/companyname.de/_git/companyname-client.git?path=/README.md&version=GBbranchname&line=1&lineEnd=2&lineStartColumn=1&lineEndColumn=1&lineStyle=plain&_a=contents

I cloned the project via ssh, so maybe this is not supported?

ben-gibson commented 2 years ago

What does your remote configuration show? $ git remote -v

StefanLobbenmeier commented 2 years ago
origin  git@ssh.dev.azure.com:v3/companyname/companyname.de/companyname-client.git (fetch)
origin  git@ssh.dev.azure.com:v3/companyname/companyname.de/companyname-client.git (push)
ben-gibson commented 1 year ago

Are there self hosted options or custom domain support in Azure? If not, this could be as simple as just assuming https://dev.azure.com/ as the host.

cjoecker commented 1 year ago

I don’t have a self-hosted repo and also have the same difference in the url: an extra ssh. and v3 Maybe it creates a different url when the repo is cloned using ssh?

ben-gibson commented 1 year ago

Possibly fixed in the latest version 4.2.3 🤞🤞

StefanLobbenmeier commented 1 year ago

Thanks I will try tomorrow ❤️

StefanLobbenmeier commented 1 year ago

It is almost right, I think it is missing a .git at the end of the url:

https://dev.azure.com/companyname/companyname.de/_git/projectname?httpParams

is being generated, but I manually have to change it to

https://dev.azure.com/companyname/companyname.de/_git/projectname.git?httpParams

Otherwise it says

Repository "projectname" not found

image

ben-gibson commented 1 year ago

Does this work now on v4.2.4?

StefanLobbenmeier commented 1 year ago

I will give it a shot on Monday :smile: thanks

cjoecker commented 1 year ago

I tried it and it works, thanks a lot!!

StefanLobbenmeier commented 1 year ago

Sorry did not get the plugin update yesterday, but today I was able to update and I can also confirm the bug to be fixed :) thank you very much ❤️