You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Submodule with 'ssh:// method' and alternate port breaks hyperlink in webui #4941
Check the link to the module and .gitmodules.
My git is down so the link wouldn't work anyway, but the issue is gogs is linking the ssh port (even tho my git is down, the link is the issue).
This is still a problem with the latest version:
Application version
0.13.0+dev
Git version
2.24.3
In my case I have in app.ini:
[server]
SSH_PORT = 8022
OFFLINE_MODE = true
In .gitmodules I have:
[submodule "generic"]
path = generic
url = ssh://git@:8022/<repo_name>
In the gogs UI the submodule link reads:
http://:8022/<repo_name>
but it should read:
http:///<repo_name>
@juning98@unknwon I also met this problem. When creating submodule with ssh link, the repo will also direct wrongly to ssh port with webUI. So could you fix it since all of us seems not familar with Go language...
Activity
unknwon commentedon Oct 25, 2018
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?
zefie commentedon Oct 25, 2018
Check the link to the module and .gitmodules.
My git is down so the link wouldn't work anyway, but the issue is gogs is linking the ssh port (even tho my git is down, the link is the issue).
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/"
psyciknz commentedon Jun 17, 2019
I've just created a submodule link also using ssh (to port 8022).
My main project is:
ssh://[email protected]:8022/Docker/Docker.gitmy submodule is
In the web UI of Gogs the link for the
conffolder in theopenhabdirectory is forhttps://git.domain/8022/HomeAutomation/OpenHAB/commit/f49efa46370da23ec34055d568a6b8401755516a
So it's taken the :8022 port and made a folder as part of the link.
swearl commentedon Oct 18, 2019
same issue.... 2 years neved fix?
chill1n commentedon Apr 18, 2021
This is still a problem with the latest version:
Application version
0.13.0+dev
Git version
2.24.3
In my case I have in app.ini:
[server]
SSH_PORT = 8022
OFFLINE_MODE = true
In .gitmodules I have:
[submodule "generic"]
path = generic
url = ssh://git@:8022/<repo_name>
In the gogs UI the submodule link reads:
http://:8022/<repo_name>
but it should read:
http:///<repo_name>
zefie commentedon Apr 18, 2021
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
else include port in url
TheDarkUndoing commentedon Nov 25, 2022
If someone finds the section in the codebase, I'll write a patch for it. I have intermediate experience with Go.
unknwon commentedon Dec 9, 2022
This is the function that infers the URL for submodule.
bioinformatist commentedon Jan 9, 2023
@juning98 @unknwon I also met this problem. When creating submodule with ssh link, the repo will also direct wrongly to ssh port with webUI. So could you fix it since all of us seems not familar with Go language...
Thanks in advance!:smile:
TheDarkUndoing commentedon Jan 9, 2023
I might be missing something but I dont see the function.
unknwon commentedon Feb 28, 2023
Sorry! 😂 did not realize I didn't paste the link in:
gogs/internal/gitutil/submodule.go
Line 23 in fb6693f
TheDarkUndoing commentedon Feb 28, 2023
Thank you, I think the logic would go in here somewhere. I need to figure out how to test this though.
unknwon commentedon Feb 28, 2023
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
TheDarkUndoing commentedon Feb 28, 2023
Thank you for pointing that out, was about to waste alot of time building the whole app
TheDarkUndoing commentedon Mar 2, 2023
I would like to get some eyes on the patch I added. #7383