git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Erik Cervin EdinNext: Chris Torek
Message 8 of 24 in “Proposal: tell git a file has been renamed”
  1. Jeremy MortonApr 22, 2023
  2. rsbecker@nexbridge.comApr 22, 2023
  3. Jeremy MortonApr 22, 2023
  4. rsbecker@nexbridge.comApr 22, 2023
  5. Jeremy MortonApr 22, 2023
  6. rsbecker@nexbridge.comApr 22, 2023
  7. Erik Cervin EdinApr 23, 2023
  8. Kristoffer HaugsbakkApr 23, 2023
  9. Chris TorekApr 24, 2023
  10. Jeremy MortonApr 24, 2023
  11. Chris TorekApr 24, 2023
  12. Erik Cervin EdinApr 24, 2023
  13. Jeremy MortonApr 24, 2023
  14. Erik Cervin EdinApr 24, 2023
  15. Jeremy MortonApr 24, 2023
  16. Felipe ContrerasApr 24, 2023
  17. Jacob KellerApr 24, 2023
  18. Felipe ContrerasApr 24, 2023
  19. Jacob KellerApr 26, 2023
  20. Junio C HamanoApr 26, 2023
  21. Erik Cervin EdinMay 11, 2023
  22. Junio C HamanoApr 24, 2023
  23. Junio C HamanoApr 24, 2023
  24. Jeremy MortonApr 24, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.