Skip to content

Make submodule link work with relative path #35034

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

Merged
merged 5 commits into from
Jul 10, 2025

Conversation

wxiaoguang
Copy link
Contributor

Fix #35033

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 10, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Jul 10, 2025
@wxiaoguang wxiaoguang added the backport/v1.24 This PR should be backported to Gitea 1.24 label Jul 10, 2025
@wxiaoguang wxiaoguang added this to the 1.25.0 milestone Jul 10, 2025
@wxiaoguang wxiaoguang added type/bug skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels Jul 10, 2025
@wxiaoguang
Copy link
Contributor Author

Diff with ignoring spaces: https://github.com/go-gitea/gitea/pull/35034/files?w=1

@AdamMajer
Copy link
Contributor

Will this also fix the link in a PR where a submodule is changed?

@wxiaoguang
Copy link
Contributor Author

a submodule is changed?

I think yes, they use the same logic.

@AdamMajer
Copy link
Contributor

https://demo.gitea.com/gnuman/rel_submodule_test/pulls/1/files

This view is still broken. On my test instance with the patch, I see

image

@wxiaoguang
Copy link
Contributor Author

https://demo.gitea.com/gnuman/rel_submodule_test/pulls/1/files

This view is still broken. On my test instance with the patch, I see

Hmm, the relative path is working, but the problem is that the pull's page doesn't share the same path layout, so "../../" is relative to "https://demo.gitea.com/gnuman/rel_submodule_test/pulls/1".

Not easy to fix ....

@wxiaoguang
Copy link
Contributor Author

I have some ideas to fix now, but the changes will be many, and won't be able to backport.

So I think we can have this fix first, and then refactor the "submodule relative path" problem later.

@AdamMajer
Copy link
Contributor

Agreed. The relative-path submodule diff is not really a regression from 1.23.x since it wasn't available back then.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 10, 2025
@wxiaoguang wxiaoguang enabled auto-merge (squash) July 10, 2025 16:12
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 10, 2025
@wxiaoguang wxiaoguang merged commit f35dcfd into go-gitea:main Jul 10, 2025
26 checks passed
@wxiaoguang wxiaoguang deleted the fix-submodule-relpath branch July 10, 2025 16:46
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Jul 10, 2025
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Jul 10, 2025
wxiaoguang added a commit that referenced this pull request Jul 10, 2025
Backport #35034 by wxiaoguang

Fix #35033

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jul 11, 2025
* giteaofficial/main:
  Fix updating user visibility (go-gitea#35036)
  Fix git commit committer parsing and add some tests (go-gitea#35007)
  Refactor OpenIDConnect to support SSH/FullName sync (go-gitea#34978)
  Support base64-encoded agit push options (go-gitea#35037)
  Also display "recently pushed branch" alert on PR view (go-gitea#35001)
  Make submodule link work with relative path (go-gitea#35034)
  Update to go 1.24.5 (go-gitea#35031)
  Improve CLI commands (go-gitea#34973)
  Tweak eslint config, fix new issues (go-gitea#35019)

# Conflicts:
#	templates/repo/commits_list.tmpl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/done All backports for this PR have been created backport/v1.24 This PR should be backported to Gitea 1.24 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend modifies/go Pull requests that update Go code skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

regression: relative URL paths in .gitmodules no longer produce correct submodule links
6 participants