Skip to content

File history for renamed files, with '--follow' equivalent to show the complete history#34686

Closed
Chi-Iroh wants to merge 15 commits intogo-gitea:mainfrom
Chi-Iroh:main
Closed

File history for renamed files, with '--follow' equivalent to show the complete history#34686
Chi-Iroh wants to merge 15 commits intogo-gitea:mainfrom
Chi-Iroh:main

Conversation

@Chi-Iroh
Copy link
Copy Markdown

@Chi-Iroh Chi-Iroh commented Jun 10, 2025

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 :
image

Rename following enabled :
image

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

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 ?

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 10, 2025
Comment thread web_src/js/features/repo-commit.ts Outdated
Copy link
Copy Markdown
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread modules/git/commit.go Outdated
Comment thread modules/git/repo_commit.go Outdated
Comment thread web_src/js/features/repo-commit.ts Outdated
Comment thread web_src/js/features/repo-commit.ts Outdated
Comment thread templates/repo/commits_table.tmpl Outdated
@wxiaoguang
Copy link
Copy Markdown
Contributor

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.

@Chi-Iroh
Copy link
Copy Markdown
Author

@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.
Also, the forced pushes were because I made a mistake / forgot something important in a commit I just pushed, sorry for these.

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.

@wxiaoguang
Copy link
Copy Markdown
Contributor

I don't know what you have done on your side.

Now, these pages contains unrelated changes:

@Chi-Iroh
Copy link
Copy Markdown
Author

Chi-Iroh commented Jun 16, 2025

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 ?

@Chi-Iroh Chi-Iroh marked this pull request as draft June 23, 2025 08:07
@github-actions github-actions Bot added modifies/cli docs-update-needed The document needs to be updated synchronously and removed modifies/templates labels Jun 23, 2025
@Chi-Iroh Chi-Iroh closed this Jun 23, 2025
@Chi-Iroh Chi-Iroh reopened this Jun 23, 2025
@github-actions github-actions Bot added modifies/templates and removed modifies/cli docs-update-needed The document needs to be updated synchronously labels Jun 23, 2025
@Chi-Iroh
Copy link
Copy Markdown
Author

I messed up a bit, but I guess I cleaned the history.

@Chi-Iroh Chi-Iroh marked this pull request as ready for review June 23, 2025 08:29
@wxiaoguang
Copy link
Copy Markdown
Contributor

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.

@Chi-Iroh
Copy link
Copy Markdown
Author

Ok got it. Feel free to ask if I can help.

@Chi-Iroh Chi-Iroh closed this by deleting the head repository Jul 4, 2025
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Oct 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File history for renamed files, with '--follow' equivalent to show the complete history

5 participants