gitea icon indicating copy to clipboard operation
gitea copied to clipboard

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

Open kanutron opened this issue 2 years ago • 4 comments

Feature Description

Consider the scenario where a given file has 1+ change in its commit history, then the file is renamed using git mv or so, and then the file receives another change.

In the command line git, you can get the log changes before renaming the file using --follow.

When viewing the same history in the Web UI, the history of that file ends where the file was last renamed. Giving the false impression of history lost.

A simple button/check to activate the --follow option would be much appreciated. In fact, I'd say this should be enabled by default.

To see it, given a file that was renamed, check its history in the web UI and then compare it with the following:

As Gitea does:

git log FILE

As Gitea should do:

git log --follow FILE

Screenshots

No response

kanutron avatar Nov 28 '23 11:11 kanutron

Hello Looks like it was removed intentionally https://github.com/go-gitea/gitea/commit/58a4407acb04b329e94e92977b1414feb309d5de

Could it be made switchable? Somewhere in config. Not every installations have large repos, but having full history is rather convenient.

Abyss777 avatar Dec 04 '23 12:12 Abyss777

I would like to add that viewing the git blame in the Web UI will show you commits from before the rename. This might induce a head scratching moment because some of the commits in the blame may not be visible in the Web UI history.

cswartzvi avatar Dec 21 '23 15:12 cswartzvi

I think this should be triggerable via the history view of a file.

Where you could trigger it manually or remember it for that specific file and future renames. grafik

this than triggers the --follow

Mosch0512 avatar Feb 08 '24 09:02 Mosch0512

Nice idea, I'd like that too. EDIT: I'm working on it, but I haven't opened a PR for now

Chi-Iroh avatar Jun 05 '25 13:06 Chi-Iroh