Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Internal bitbucket server support #66

Open
jchapuis opened this issue Oct 30, 2015 · 12 comments
Open

Internal bitbucket server support #66

jchapuis opened this issue Oct 30, 2015 · 12 comments

Comments

@jchapuis
Copy link

Hi, we are using a version of bitbucket hosted internally (e.g. bitbucket.foobar.com) could such urls be supported as well?

@GeertvanHorrik
Copy link
Contributor

I think you can already specify a custom url?

@jchapuis
Copy link
Author

Thanks for your answer! at present if I run e.g. GitLink.exe ../ -u https://bitbucket.fobar.com/ I get the following exception: GitLink.GitLinkException: Cannot determine git provider

@GeertvanHorrik
Copy link
Contributor

You are right. We need a custom "provider" argument. Interested in doing a PR?

@jchapuis
Copy link
Author

Thanks! This is still not helping however, since hosted bitbucket (stash) uses a different url pattern, like this: http://host/projects/{project}/repos/{repo}/browse/path/to/file.ext?at=revision&raw
There's a suggestion for something more standard (https://jira.atlassian.com/browse/BSERV-4036) but nothing ready yet. Ideally we should be able to provide the entire url pattern as well. I could imagine supporting placeholders in the url given on the command line.

@GeertvanHorrik
Copy link
Contributor

Interested in doing a PR? Should be very easy to do now?

@sMusy
Copy link
Contributor

sMusy commented Nov 24, 2015

Hi, I tried to implement the functionality mentioned in that topic and I'd like to do a PR.

I did pretty much the same thing as Marcind with his CustomRawUrlProvider, here is the readme part.

Running for an uncommon URL

When working with a repository using uncommon URL you can use placeholders to specifiy where the filename and revision hash should be, use -u parameter with the custom URL

GitLink.exe c:\source\catel -u "https://host/projects/catel/repos/catel/browse/{filename}?at={revision}&raw"

The custom url will be used to fill the placeholders with the relative file path and the revision hash.

@GeertvanHorrik
Copy link
Contributor

Sounds good. As long as we maintain backwards compatibility with the other pr, go ahead :-)

sMusy pushed a commit to sMusy/GitLink that referenced this issue Nov 30, 2015
…s#66

I did pretty much the same thing as Marcind with his CustomRawUrlProvider, here is the readme part.

Running for an uncommon URL

When working with a repository using uncommon URL you can use placeholders to specifiy where the filename and revision hash should be, use -u parameter with the custom URL

       GitLink.exe c:\source\catel -u "https://host/projects/catel/repos/catel/browse/{filename}?at={revision}&raw"

The custom url will be used to fill the placeholders with the relative file path and the revision hash.

I also added an option to download the sources with powershell because SRCSRV http support doesn't accept characters like "?" thus another option was needed
@shonnly
Copy link
Contributor

shonnly commented May 28, 2016

This is an awesome feature really!
By the way, seems like a common issue with internal Git repositories is dealing with some kind of authentication mechanism. I had the same problem, so i ended up setting up a tiny Web Api service that queries a local clone of a repository on the server.

I was bombarded at my company with requests for assistance in setting this up, so wrote a post about it here. Hope this helps more people with using your amazing library!

https://shonnlyga.wordpress.com/2016/05/28/source-server-with-git-repository/

@GeertvanHorrik
Copy link
Contributor

@shonnly This is really awesome, well done! I thought that GitLink already supported powershell commands to retrieve the files? The other 2 changes could be embedded too, then you don't have to maintain a custom version of GitLink.

@shonnly
Copy link
Contributor

shonnly commented May 28, 2016

@GeertvanHorrik - It does, but the command printed to the .pdb did not work for me. I asked at #73 to make sure if that is only me. If others experience similar issue with the powershell command, i'd love to make PR with a fix.

As for the other 2 changes, i'll try and find the time to generalize the solution and submit a PR.

@GeertvanHorrik
Copy link
Contributor

@shonnly Sorry for my late reply, been busy. Let's assume you were not the only one with issues with the powershell. Could you please create a PR?

About the other 2: would be great to see them as well, but no rush, I can imagine you have other tasks on your plate as well. Thanks in advance!

@shonnly
Copy link
Contributor

shonnly commented Sep 29, 2016

@GeertvanHorrik Oh, sorry for ignoring this for so long, couldn't get to it. Anyway, found some time to open the source again today, and made a PR with the Powershell fix. It solved the issues for me, however Powershell is not my mother's tongue, so would be great to get some feedback on the fix.

Once again, great tool!

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

No branches or pull requests

4 participants