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

Re: git rename/moved status unreliable in ruby

From
Junio C Hamano <gitster@pobox.com>
Date
May 5, 2026, 00:09 UTC
Message-ID
<xmqqecjqpvhw.fsf@gitster.g>
In-Reply-To
<CAPx1Gvd_VEWHrBWtUjNeWZ+wfmsAOTamKmL6fhBSQi=MbmXRcw@mail.gmail.com>
Chris Torek <chris.torek@gmail.com> writes:
> This is why -- and when -- making two separate commits, one with
> "exact same content for deleted-file-D vs added-file-A", followed by
> later changes to new file A, helps: if you compare the commit that has

"helps" -> "somtimes helps". Only when comparison is done step-wise (e.g., "git log -M/--follow" and "git rebase"), it may help, but in general, when comparison between only two endpoints matter (e.g., "git diff" and "git merge"), such an artificial breaking of a logically single change into two does not help.

Show 8 quoted lines
>> If this is considered something that can be improved ...
>
> It *could* be improved. Doing so in a way that works for more than
> just some special cases -- e.g., in a way that works for ordinary
> text, or graphical images, for instance, rather than just for Ruby
> sources (or just C sources, or C++, or Swift, or Python, or whatever)
> -- seems particularly tricky. Some degree of ignoring white-space
> changes would probably help multiple cases, though.

You could tie it with the attributes system to allow logic specialized for the nature of the contents. The beauty of the design decision to store "snapshots" is that these heuristics can be improved without having to change anything in the history that are cast in stone.

Previous: Jeff KingNext: Chris Torek
Message 8 of 9 in “git rename/moved status unreliable in ruby”
  1. sebastien.stettlerMay 1, 2026
  2. Phillip WoodMay 1, 2026
  3. Johannes SixtMay 2, 2026
  4. Junio C HamanoMay 3, 2026
  5. Chris TorekMay 2, 2026
  6. sebastien.stettlerMay 2, 2026
  7. Jeff KingMay 4, 2026
  8. Junio C HamanoMay 5, 2026
  9. Chris TorekMay 5, 2026

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.