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

Re: Git Rename Detection Bug

From
Philip Oakley <philipoakley@iee.email>
Date
Nov 11, 2023, 11:08 UTC
Message-ID
<9baca4af-a570-4b7a-a1ee-de91b809e79c@iee.email>
In-Reply-To
<CABPp-BHEX+SyophEfgRqDbNdrAS3=bptt_cKzHLBSutnBAxexw@mail.gmail.com>
Hi all,
On 11/11/2023 05:46, Elijah Newren wrote:
> The fact that you were trying to "undo" renames and "redo the correct
> ones" suggested there's something you still didn't understand about
> rename detection, though.

Could I suggest that we are missing a piece of terminology, to wit, BLOBSAME. It's a compatriot to TREESAME, as used in `git log` for history simplification (based on a tree's pathspec, most commonly a commit's top level path).

File rename, at it's most basic, is when the blob associated with that changed path is identical, i.e. BLOBSAME. There is no need to 'record' the action of renaming, moving or whatever, the content sameness is right there, in plain sight, as an identical blob name. After that (files with slight variations) it is a load of heuristics, but starting with BLOBSAME we see how easy the basic rename detection is, and why renames (and de-dup) don't need recording.

The heuristics of 'rename with small change' is trickier, but for a basic understanding, starting at BLOBSAME (and TREESAME for directory renames) should make it easier to grasp the concepts.

--
Philip
Previous: Elijah NewrenNext: Elijah Newren
Message 5 of 13 in “Git Rename Detection Bug”
  1. Jeremy PridmoreNov 6, 2023
  2. Elijah NewrenNov 7, 2023
  3. Jeremy PridmoreNov 10, 2023
  4. Elijah NewrenNov 11, 2023
  5. Philip OakleyNov 11, 2023
  6. Elijah NewrenNov 11, 2023
  7. Junio C HamanoNov 12, 2023
  8. Philip OakleyNov 15, 2023
  9. Philip OakleyNov 15, 2023
  10. Elijah NewrenNov 16, 2023
  11. Philip OakleyNov 15, 2023
  12. Elijah NewrenDec 24, 2023
  13. Philip OakleyDec 28, 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.