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

Re: git rename/moved status unreliable in ruby

From
Chris Torek <chris.torek@gmail.com>
Date
May 5, 2026, 00:46 UTC
Message-ID
<CAPx1GveSn30Ua6fD3ZhiRHiN+-DpcN=9FbUcY3GstiXz9UYZ_Q@mail.gmail.com>
In-Reply-To
<xmqqecjqpvhw.fsf@gitster.g>
On Mon, May 4, 2026 at 5:09 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
> Chris Torek <chris.torek@gmail.com> writes:
>
> > This is why -- and when -- making two separate commits ... helps
>
> "helps" -> "somtimes helps".  Only when comparison is done step-wise
> (e.g., "git log -M/--follow" and "git rebase"), it may help,
That's why I said "and when". :-)
 > > ... Some degree of ignoring white-space
Show 7 quoted lines
> > 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.

Indeed. Something like Peff's suggestion might work, although I see some danger in ignoring white space completely. It would probably be better to compress "all leading but non-empty white space" to either nothing or a single space, eliminate all trailing white space, and compress other white space to a single blank.

(Though at the same time, when we're dealing with slugs extracted from very long single lines, this is probably wrong, so perhaps this should only be done for "intact single line" slugs. Then again it might not matter at this point.)

Doing this on binary files and programs written in Whitespace[1] would be wrong, of course. ;-)

Chris
[1]: https://en.wikipedia.org/wiki/Whitespace_(programming_language)
Previous: Junio C Hamano
Message 9 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.