-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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 diff support for renamed/copied file changes on commit page #15335
Comments
@joseluisq Could you provide the diff patch file? |
Yes, please replicate this on try.gitea.io |
And tell us what version of git you're using - it's highly relevant |
Ok, I will try to replicate this on try.gitea.io. I have locally git 2.31.1 |
@lunny full diff patch file content in the issue description (updated). |
@zeripath question
|
yes - it would be useful to know if it is present in master - and if you can present a case that would fail on your set-up but does not on try we can try it on various configurations to understand what is making it a heisenbug. My suspicion is that the case is related to improvements in git's diff output so we wouldn't have seen it or handled it before. I'll take another look at the patch parsing code to see if the issue is there - but as I say it would be excellent to have a testcase to that we can show where it fails. -- (ah I see you've updated your comment with the patch - that is extremely helpful!) |
Alright, I will give it a test during the day then. |
OK on master and origin/release/v1.13 ParsePatch is handling this correctly - so the issue is going to be at the template level I suspect |
yup and looking at templates/repo/diff/box.tmpl: gitea/templates/repo/diff/box.tmpl Lines 52 to 54 in 05b7e32
gitea/templates/repo/diff/box.tmpl Lines 90 to 92 in 05b7e32
We can see that the compare box won't display if the file is marked as IsRenamed. So in which case this is likely a really simple fix - we just need to figure out what happens if we drop that IsRenamed test and if that works fine when there is no diff then boom we're done. So the above is just dealing with the header bar. We need to fix here to show the diff: gitea/templates/repo/diff/box.tmpl Line 116 in 05b7e32
|
Great, you got it. |
Well if you have a simple reproducible example that would always be helpful. |
Ok, I will not bother you more I will give it a test. |
More recent versions of git have increased support for detection of renames meaning that a rename with diff changes is now supported. Although ParsePatch supports this - our templates do not and the simplest solution is simply to show the diff. Fix go-gitea#15335 Signed-off-by: Andrew Thornton <[email protected]>
Backport go-gitea#15338 More recent versions of git have increased support for detection of renames meaning that a rename with diff changes is now supported. Although ParsePatch supports this - our templates do not and the simplest solution is simply to show the diff. Fix go-gitea#15335 Signed-off-by: Andrew Thornton <[email protected]>
Backport go-gitea#15338 More recent versions of git have increased support for detection of renames meaning that a rename with diff changes is now supported. Although ParsePatch supports this - our templates do not and the simplest solution is simply to show the diff. Fix go-gitea#15335 Signed-off-by: Andrew Thornton <[email protected]>
Try #15340 (for 1.13) Either download the requisite template and stick it in the correct place or compile from that PR. |
Ok, since you have just modified the diff template and for closer verification and I will use it as a custom template directly in my server. |
Confirmed, it shows now the renamed diff. |
More recent versions of git have increased support for detection of renames meaning that a rename with diff changes is now supported. Although ParsePatch supports this - our templates do not and the simplest solution is simply to show the diff. Fix #15335 Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: 6543 <[email protected]>
Backport #15338 More recent versions of git have increased support for detection of renames meaning that a rename with diff changes is now supported. Although ParsePatch supports this - our templates do not and the simplest solution is simply to show the diff. Fix #15335 Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: 6543 <[email protected]>
Backport #15338 More recent versions of git have increased support for detection of renames meaning that a rename with diff changes is now supported. Although ParsePatch supports this - our templates do not and the simplest solution is simply to show the diff. Fix #15335 Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: 6543 <[email protected]>
More recent versions of git have increased support for detection of renames meaning that a rename with diff changes is now supported. Although ParsePatch supports this - our templates do not and the simplest solution is simply to show the diff. Fix go-gitea#15335 Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: 6543 <[email protected]>
[x]
):Description
I have realized that Gitea is not supporting diff changes for renamed/copied files on the commit page view.
Page URL:
/username/repo/commit/hash
Screenshots
For instance, I have a commit which contains a file renamed but with some additions and deletions.
Below an extract of my
git show
My full Git diff patch file content:
0001-feat-tagged-html-templates-support.patch
However what I get in the GUI is this empty section:
So I would be great if Gitea could add support for this.
The text was updated successfully, but these errors were encountered: