rscherf / GitLink

Open your Sublime Text files on GitHub, Bitbucket, Gitlab or Codebase
http://ryan.sc
34 stars 25 forks source link

Don't work with Gitlab groups #34

Open bibendi opened 5 months ago

bibendi commented 5 months ago

Hi! The link generation doesn't work well with Gitlab groups. For example, git@gitlab.selfhost.io:group1/group2/repo-name.git => https://gitlab.selfhost.io/group1/group2/-/blob/master/some-file.md. But it should be like https://gitlab.selfhost.io/group1/group2/repo-name/-/blob/master/some-file.md

kayoo123 commented 5 months ago

same error to me...

rscherf commented 5 months ago

Feel free to submit a PR ensuring backwards compatibility.

kayoo123 commented 4 months ago

I'm very bad with python; I think it's where you get repo variable... (I see, we use custom private domain gitlab, maybe it's HOSTINGS value which are not compatible)

I read that you use : git rev-parse ..., but it show empty when I try with cli.

Have you think of another way to get this info ?

maybe like this :

## Get remote URL
git config --get remote.origin.url
    git@gitlab.jeremi.fr:group/project.git

## Translate to HTTPS
git config --get remote.origin.url |sed -r 's/git@([^:]*):(.*).git/https:\/\/\1\/\2/'
    https://gitlab.jeremi.fr/group/project

Hope this help...

kayoo123 commented 2 days ago

no news ?

kayoo123 commented 1 day ago

As I don't understand why I'm being downvoted, I'm sharing an alternative version using the build system

here's the link: https://forum.sublimetext.com/t/giturltoclipboard/72778

michaelblyons commented 1 day ago

Downvote for assuming updates. Maintainer has already stated he'd consider a PR if it didn't cause regressions. I didn't downvote any of your other comments.

You're unwilling to write any Python. Would you be interested in experimenting with just a regex change? Possibly the only thing required is to change the contents of some capture groups.

https://github.com/rscherf/GitLink/blob/master/GitLink.py#L82