Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcehut links broken - missing user/namespace #36

Closed
samhh opened this issue Nov 28, 2021 · 2 comments · Fixed by #38
Closed

Sourcehut links broken - missing user/namespace #36

samhh opened this issue Nov 28, 2021 · 2 comments · Fixed by #38
Assignees
Labels
bug Something isn't working hosts

Comments

@samhh
Copy link

samhh commented Nov 28, 2021

Generated Sourcehut links are broken. GitHub is fine. Unmodified callbacks config. Happens with all my repos, example: https://git.sr.ht/~samhh/bangin

The output is: https://git.sr.ht/bangin/tree/a99b870dfe56d6b79988d98bf71d5a0b7f6cd4e1/item/bangin.sh#L6

But should be: https://git.sr.ht/~samhh/bangin/tree/a99b870dfe56d6b79988d98bf71d5a0b7f6cd4e1/item/bangin.sh#L6

Note the additional /~samhh. I'm not sure how the repo remote is calculated but it should be parseable:

$ git remote -v
origin	[email protected]:~samhh/bangin (fetch)
origin	[email protected]:~samhh/bangin (push)
@samhh samhh added the bug Something isn't working label Nov 28, 2021
@ruifm
Copy link
Owner

ruifm commented Nov 29, 2021

Thanks for the detailed issue report.

I found the cause:

local function parse_repo_path(stripped_uri, host, port, errs)
assert(host)
local pathChars = "[/_%-%w%.]+"

it's missing ~ as an allowed char. I will file a PR soon, if I forget, feel free to ping me.

@samhh
Copy link
Author

samhh commented Nov 29, 2021

Just wanted to confirm it's fixed on my end, many thanks!

samhh added a commit to samhh/dotfiles that referenced this issue Nov 29, 2021
This fixes a bug in gitlinker with Sourcehut:
ruifm/gitlinker.nvim#36
stevanmilic pushed a commit to stevanmilic/gitlinker.nvim that referenced this issue Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hosts
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants