File history for renamed files, with '--follow' equivalent to show the complete history#34686
File history for renamed files, with '--follow' equivalent to show the complete history#34686Chi-Iroh wants to merge 15 commits intogo-gitea:mainfrom Chi-Iroh:main
Conversation
wxiaoguang
left a comment
There was a problem hiding this comment.
Thank you very much for the PR.
Although it needs more improvements to follow Gitea's code guideline, the idea is good enough.
I can help to make future improvements, before making more changes, I have some questions, see below.
|
The commit history became a mess. Please follow git's manual to maintain the commits, and then force-push after fixing the problems. And one more thing, when review starts and there is no special requirement, please avoid rebase&force-push. |
|
@wxiaoguang I'll be glad to fix what you'd like, but could you tell me what exactly is wrong ? I genuinely don't know what to do about the commits and don't understand why you said it's a mess. And last, what about the failing checks ? The frontend one is because of a change silvermind asked me to do, and as far as I understand, the vulnerability one is unrelated with what I changed. |
|
I don't know what you have done on your side. Now, these pages contains unrelated changes: |
|
Ok, that's because I thought I ought to update my branch to upstream to check I didn't break something, so that's why these commits are here. I'll drop them with a rebase, is it ok for you ? |
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
|
I messed up a bit, but I guess I cleaned the history. |
|
Thank you for the update. The commits are clear now. Actually this feature is not as easy as a "good first issue" for new contributors. I can see there are still some problems in code, for example: we can't depend on the unstable ErrUnexpectedEOF behavior (there are other cases causing such error, and then the data would be wrong); the query parameter needs a complete backend implementation because users need to navigate between pages when the commits number is large; it needs some tests to cover the new behavior of CommitsByFileAndRange I (and maybe other maintainers) could help to take a look or make some improvements if I have time. |
|
Ok got it. Feel free to ask if I can help. |
Fixes #28253
Added a checkbox in the file history, so that we can toggle following renames.
I made a test repo, with a first commit creating a file, and a second one renaming it.
Here is what the history looks.
Rename following disabled :

Rename following enabled :

As a reminder, here's what it looks like now :

However, I have a question: I inserted a small spacing between the text and the checkbox, and as 1em and 1rem looked too big, I put 5px instead. Is it OK to use an absolute size in this context ?