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

RE: Feature request: git cp

From
rsbecker@nexbridge.com <rsbecker@nexbridge.com>
Date
Nov 21, 2025, 00:10 UTC
Message-ID
<010b01dc5a7b$4790ee30$d6b2ca90$@nexbridge.com>
In-Reply-To
<6F4B3935-7F2F-43C9-8E5E-12E2FB3331BD@gmail.com>
On November 20, 2025 6:08 PM, Lucas Seiki wrote:
>> and would like the history to track the relevant lines in each file,
>> like "git mv" does,
>
>As a consequence of Git being based on snapshots instead of deltas (see
[1]), `git
>mv` actually doesn't keep track of renames. You can think of `git mv` as
`git rm`ing
>the file with the old name + `git add`ing the same file with the the new
name.
>
>As Kristoffer said, the renames are detected by tools like `git log`, `git
diff` or `git
>status` based on similarity between files, which are considered a rename if
they are
>similar enough. That similarity can even be tuned by using the flag
--find-renames,
>available in those three commands.
>
>
>[1] https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F

I know this might sound trite or wrong but... does this mean that git log can actually detect SHA-1 collisions based on similarity checks of file contents?

Previous: Martin GuyNext: Martin Guy
Message 8 of 10 in “Feature request: git cp”
  1. Martin GuyNov 20, 2025
  2. Kristoffer HaugsbakkNov 20, 2025
  3. D. Ben KnobleNov 20, 2025
  4. Martin GuyNov 20, 2025
  5. D. Ben KnobleNov 20, 2025
  6. Lucas Seiki OshiroNov 20, 2025
  7. Martin GuyNov 20, 2025
  8. rsbecker@nexbridge.comNov 21, 2025
  9. Martin GuyNov 21, 2025
  10. Lucas Seiki OshiroNov 21, 2025

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.