regression: relative URL paths in .gitmodules no longer produce correct submodule links #14738

Closed
opened 2025-11-02 11:21:38 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @AdamMajer on GitHub (Jul 10, 2025).

Description

Relative paths in url= elements of .gitmodules used to work with 1.23.7 but now fail to work with 1.24.2 and latest demo. For example,

https://demo.gitea.com/gnuman/rel_submodule_test

The format in .gitmodules is url=../../org/repo instead of url=https://demo.gitea.com/org/repo. The relative path allows one to move repositories to different instance and the checkout will continues to work.

Gitea Version

1.24.2

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Self-hosted

Database

PostgreSQL

Originally created by @AdamMajer on GitHub (Jul 10, 2025). ### Description Relative paths in `url=` elements of .gitmodules used to work with 1.23.7 but now fail to work with 1.24.2 and latest demo. For example, https://demo.gitea.com/gnuman/rel_submodule_test The format in .gitmodules is `url=../../org/repo` instead of `url=https://demo.gitea.com/org/repo`. The relative path allows one to move repositories to different instance and the checkout will continues to work. ### Gitea Version 1.24.2 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Self-hosted ### Database PostgreSQL
GiteaMirror added the type/bug label 2025-11-02 11:21:38 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Jul 10, 2025):

Related to add submodule diff links (#33097)

Then it's unable to generate "CommitWebLink" for such "relative path" case.


Maybe we can just keep the relative path

@wxiaoguang commented on GitHub (Jul 10, 2025): Related to add submodule diff links (#33097) Then it's unable to generate "CommitWebLink" for such "relative path" case. --- Maybe we can just keep the relative path
Author
Owner

@wxiaoguang commented on GitHub (Jul 10, 2025):

I think this one will fix? Make submodule link work with relative path #35034

And added new tests

Image
@wxiaoguang commented on GitHub (Jul 10, 2025): I think this one will fix? Make submodule link work with relative path #35034 And added new tests <img width="1200" height="242" alt="Image" src="https://github.com/user-attachments/assets/400d1861-dd0a-4a69-82d7-29afa23680de" />
Author
Owner

@AdamMajer commented on GitHub (Jul 14, 2025):

Image

It seems it's still broken in the case of ../docs relative path. So same organization but different repository.

@AdamMajer commented on GitHub (Jul 14, 2025): <img width="480" height="364" alt="Image" src="https://github.com/user-attachments/assets/0e130734-c9a5-49db-a715-09aacd26d969" /> It seems it's still broken in the case of `../docs` relative path. So same organization but different repository.
Author
Owner

@wxiaoguang commented on GitHub (Jul 14, 2025):

Hmm, the complete is Improve submodule relative path handling #35056 , could you try that fix?

@wxiaoguang commented on GitHub (Jul 14, 2025): Hmm, the complete is Improve submodule relative path handling #35056 , could you try that fix?
Author
Owner

@AdamMajer commented on GitHub (Jul 14, 2025):

I can confirm that the improved hadling fixes all these problems that I can see. Relative and absolute submodules work well. Thanks!

@AdamMajer commented on GitHub (Jul 14, 2025): I can confirm that the improved hadling fixes all these problems that I can see. Relative and absolute submodules work well. Thanks!
Author
Owner

@wxiaoguang commented on GitHub (Jul 14, 2025):

And it also makes the submodules that in a sub-directory work, I think that doesn't work in 1.23 😆

@wxiaoguang commented on GitHub (Jul 14, 2025): And it also makes the submodules that in a sub-directory work, I think that doesn't work in 1.23 😆
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14738