GitTools / GitLink

Making .NET open source accessible!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Internal bitbucket server support

jchapuis opened this issue · comments

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

I think you can already specify a custom url?

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

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

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.

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

commented

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.

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

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/

@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.

@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.

@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!

@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!