-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
add submodule diff links #33097
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
add submodule diff links #33097
Conversation
This adds links to submodules in diffs, similar to the existing link when viewing a repo at a specific commit. It does this by expanding diff parsing to recognize changes to submodules, and find the specific refs that are added, deleted or changed. The templates are updated to add either a link to the submodule at a commit, or the diff between two commits in the event that the submodule is updated. A slight refactor was done to simplify calling RefURL on the submodule.
ps: we need this one first: Make git clone URL could use current signed-in user #33091 : it make the Git URL parsing more general ( |
Made some changes in 8d63859:
ps: need this one "Make git clone URL could use current signed-in user #33091" to rewrite |
By the way, Make git clone URL could use current signed-in user #33091 still needs one more review. It blocks this one because we need to use unified the |
Another choice is something like: The new changes after 68a8488:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI passes and it's almost done on my side.
I can't approve since it's my PR, but @wxiaoguang's changes look good to me! |
This should be fixed in ee74ae0 ![]() |
9a1444d
to
00997a3
Compare
* giteaofficial/main: add submodule diff links (go-gitea#33097) [skip ci] Updated translations via Crowdin Update status check for all supported on.pull_request.types in Gitea (go-gitea#33117) Support the new exit code for `git remote` subcommands for git version >=2.30.0 (go-gitea#33129) Make git clone URL could use current signed-in user (go-gitea#33091) Filter reviews of one pull request in memory instead of database to reduce slow response because of lacking database index (go-gitea#33106)
This is a follow-up to #33097. When linking a submodule at a commit in either the repo view, or a diff when adding a new submodule, link to the tree view of that submodules intead of the individual commit. This shows the user the full tree, instead of the diff of the commit. This makes the assumption that the tree for a given SHA is at `<repo_url>/tree/<sha>`. This URL format is supported by both Github & Gitlab, but not Gitea. To fix this, add a redirect from `<username>/<repo>/tree/<ref>` to `<username>/<repo>/src/<ref>`, so that Gitea can support this URL structure.
This adds links to submodules in diffs, similar to the existing link when viewing a repo at a specific commit. It does this by expanding diff parsing to recognize changes to submodules, and find the specific refs that are added, deleted or changed.
The templates are updated to add either a link to the submodule at a commit, or the diff between two commits in the event that the submodule is updated.
A slight refactor was done to simplify calling
RefURL
on the submodule. There was also aFIXME
comment in the template that said this should be updated to account forsetting.AppSubURL
. I tested this in an environment that uses a non defaultsetting.AppSubURL
, and verified that it works.Related #25888