-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Show changes in submodules in PR #25888
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
Comments
I don't believe we would need to fetch submodule content and change the command here. We can just coalesce the diff output between repositories directly. If there is a submodule, issue a diff to child repository -- it either is on the server, which makes this trivial, or it's not, so we can't do submodule diff then.. We already have the two relevant commit ids from the parent repository. Then replace the paths and append the diffs. Thing to keep in mind is that these submodules could be recursive and one could even craft an infinite recursion. I think that having UI option in the diff/commit view to either include the submodule diff or not would be best here. |
Yes, your approach sounds like a good idea.
|
Well, you did change them yourself, through updating the commit id for the submodule. But I agree it would be a good idea to have this visually distinct. If submodule is detected in the diff, we can add a diff submodule menu. For example,
Similar to the one we have for whitespace, etc. |
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. Related #25888 --------- Co-authored-by: wxiaoguang <[email protected]>
After #33097 was merged, reviewing changes has become easier due to submodule reversion improvements. However, since submodules can reference a remote Git server, retrieving the changed files efficiently remains a challenge, as it may introduce network latency and performance issues. |
Remote fetching should be out of scope here. It can even introduce vectors for vulnerabilities. |
I think we can mark this issue as "completed" because the review UI provides a "compare/...." link for submodules in #33097 . I also agree that we shouldn't spend time on fetching remote submodules to compare, it would cause many problems including performance regressions. |
I agree, the minimum requirements looks to be there, so this can be closed as completed. It would be nice to have ability to show these diffs inline without reloading, but that can be done at a later point. |
Feature Description
It would be very useful to be able to see changes made in submodules when reviewing a PR, instead of just seeing the changed submodule commit hash.
This is supported by git using the
git diff --submodule=diff main
option, which I'm guessing means that the changes needed on the Gitea end would be relatively small: submodule contents would need to be fetched and the diff command tweaked.I imagine this would be an option to enable (per repo, per org or globally?).
Example (cleaned for readability) output from
git diff
as it used by Gitea now:Example output using
git diff --submodule=diff
:This would make it a lot easier to review all the changes for a PR of the parent repo in a single view, instead of manually having to navigate separate PRs for each submodule. Especially in projects using many submodules, this saves a lot of time and mental effort.
You would still need to create PRs for merging the changes for each submodule into their respective main branches, but at least the review can be performed efficiently for the overall work before performing those PRs.
Screenshots
No response
The text was updated successfully, but these errors were encountered: