GitLink icon indicating copy to clipboard operation
GitLink copied to clipboard

Don't work with Gitlab groups

Open bibendi opened this issue 1 year ago • 6 comments

Hi! The link generation doesn't work well with Gitlab groups. For example, [email protected]: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

bibendi avatar Feb 01 '24 07:02 bibendi

same error to me...

kayoo123 avatar Feb 07 '24 21:02 kayoo123

Feel free to submit a PR ensuring backwards compatibility.

rscherf avatar Feb 07 '24 21:02 rscherf

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
    [email protected]: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 avatar Feb 08 '24 13:02 kayoo123

no news ?

kayoo123 avatar Jul 04 '24 14:07 kayoo123

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

kayoo123 avatar Jul 05 '24 13:07 kayoo123

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

michaelblyons avatar Jul 05 '24 22:07 michaelblyons