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
Submodule with 'ssh:// method' and alternate port breaks hyperlink in webui #4941
Comments
Hi, can you point out in https://try.gogs.io/zefie/gogs_custom_ssh_port_submodule_test, which part is wrong and what is expected? |
Check the link to the module and .gitmodules. The link should be "http://git.zefie.net/zefie/lge_g6_kernel_scripts" but is linked as "http://git.zefie.net/2222/zefie/lge_g6_kernel_scripts", because the module used "ssh://git.zefie.net:2222/" |
I've just created a submodule link also using ssh (to port 8022).
In the web UI of Gogs the link for the So it's taken the :8022 port and made a folder as part of the link. |
same issue.... 2 years neved fix? |
This is still a problem with the latest version: In my case I have in app.ini: In .gitmodules I have: |
I am not familiar with the go language but this seems fairly trivial: if (first 3 letters of repo = ssh) then do not include port in URL |
If someone finds the section in the codebase, I'll write a patch for it. I have intermediate experience with Go. |
This is the function that infers the URL for submodule. |
I might be missing something but I dont see the function. |
Sorry! 😂 did not realize I didn't paste the link in: gogs/internal/gitutil/submodule.go Line 23 in fb6693f
|
Thank you, I think the logic would go in here somewhere. I need to figure out how to test this though. |
I think you can get very far by just add a test case and check the result: https://github.com/gogs/gogs/blob/fb6693f6123c0a176097e8213b0aaaa7cef34187/internal/gitutil/submodule_test.go |
Thank you for pointing that out, was about to waste alot of time building the whole app |
I would like to get some eyes on the patch I added. #7383 |
[x]
):log/gogs.log
):(nothing related)
Description
Adding a submodule that uses an alternate port ('ssh:// method') causes the hyperlink to the submodule's git to be broken.
I guess this wouldn't normally be used (realized I was doing mine wrong) but at the same time, it could be useful in some private environments.
The text was updated successfully, but these errors were encountered: