Re: Proposal: tell git a file has been renamed
- From
Kristoffer Haugsbakk <code@khaugsbakk.name>
- Date
- Apr 23, 2023, 21:01 UTC
- Message-ID
- <f249ec0f-f2f0-43d8-bb70-5a4a7c91c608@app.fastmail.com>
- In-Reply-To
- <8fe188a9-c01f-9fb5-5877-8ff508094b22@game-point.net>
On Sat, Apr 22, 2023, at 20:01, Jeremy Morton wrote:
Show 6 quoted lines
> Could a command be added to git that means you tell Git that counts as > a file rename? Git would add a marker to the staging area that the > file has been renamed, and upon commit, would first generate an > additional commit for each rename before generating the main commit, > ensuring the rename operation counts as an actual rename, and the > content's history is maintained.
I don’t see the (conceptual) problem with a modification of this as a history rewriting tool:
• Given a series of commits: • Tool X modifies all the commits so that the default similarity index for tools like git-log(1) is triggered on intended file renames • The user will be probably be prompted with a list of initial potential renames and then will • Keep the intended renames • Remove the not-intended renames • Add the additional renames
But this looks like something that a third-party tool could implement.
-- Kristoffer Haugsbakk