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

Re: [PATCH v5] read-cache: do not trust a size change when conversion is active

From
Torsten Bögershausen <tboegi@web.de>
Date
Oct 18, 2026, 11:18 UTC
Message-ID
<20261018111851.GA27528@tb-raspi4>
In-Reply-To
<xmqq1p9twdhh.fsf@gitster.g>
On Tue, Oct 13, 2026 at 01:29:46PM -0700, Junio C Hamano wrote:
Show 28 quoted lines
> Curtis Allen Smith <curtis.allen.smith@gmail.com> writes:
> 
> > 	git status --short      # ->  M file.txt
> > 	git diff                # -> empty
> > 	git add file.txt        # -> nothing to commit
> 
> I do not think "git add" would ever say nothing to commit.
> 
> 	git commit file.txt
> 
> may say "nothing added to commit" when there is no modification made
> to file.txt to indicate that there is no change worth comitting.
> 
> There are code paths that make performance trade-offs (see the
> introductory part of Documentation/technical/racy-git.adoc for
> examples) and are designed to tolerate false positives from
> ie_modified(), filtering them out themselves.  I am somewhat
> hesitant to butcher code paths at this low level to make
> unconditional changes that reduce false positives without thinking
> things through.  For example, we may want to disable this new code
> when the 'CE_MATCH_RACY_IS_DIRTY' bit is set.  But the goal
> nevertheless should be to avoid surfacing these false positives,
> which are deliberately allowed as performance trade-offs, to code
> paths like 'git status' that do not further filter them out (as you
> demonstrated above).
> 
> There may be other cases where this patch unknowingly breaks
> carefully made performance trade-offs.

Looking at CE_MATCH_RACY_IS_DIRTY it seems as if the call to would_convert_to_git()may be better done in ie_match_stat() ?

Beside that I was able to test it with a real live repo, where a clean filter replaces a TAB with 4 spaces: Now git status no longer claims the file to be modified (and refuses to stash or other operations))

[snip]
Previous: Junio C HamanoNext: Junio C Hamano
Message 19 of 37 in “utf8.c: Prepare workaround for iconv under macOS 14/15”
  1. 1/2 utf8.c: Prepare workaround for iconv under macOS 14/15tboegi@web.de, Jan 11, 2026
  2. Junio C HamanoJan 12, 2026
  3. 1/2 utf8.c: Prepare workaround for iconv under macOS 14/15tboegi@web.de, Jan 12, 2026
  4. 0/2 Workaround for iconv under macOS 14/15tboegi@web.de, Jan 12, 2026
  5. 2/2 utf8.c: Enable workaround for iconv under macOS 14/15tboegi@web.de, Jan 12, 2026
  6. 0/1 read-cache: do not trust a size change when conversiontboegi@web.de, Oct 12, 2026
  7. 1/1 read-cache: do not trust a size change when conversion is activetboegi@web.de, Oct 12, 2026
  8. Junio C HamanoOct 12, 2026
  9. Junio C HamanoOct 13, 2026
  10. Curtis SmithOct 13, 2026
  11. Johannes SixtOct 13, 2026
  12. Curtis SmithOct 13, 2026
  13. read-cache: do not trust a size change when conversion is activeCurtis Allen Smith, Oct 13, 2026
  14. Phillip WoodOct 13, 2026
  15. Curtis SmithOct 13, 2026
  16. Torsten BögershausenOct 13, 2026
  17. read-cache: do not trust a size change when conversion is activeCurtis Allen Smith, Oct 13, 2026
  18. Junio C HamanoOct 13, 2026
  19. Torsten BögershausenOct 18, 2026
  20. Junio C HamanoOct 19, 2026
  21. Torsten BögershausenOct 20, 2026
  22. 0/1 More cs/read-cache-conversion-sizetboegi@web.de, Oct 26, 2026
  23. 1/1 read-cache: optimize file size change when conversion is activetboegi@web.de, Oct 26, 2026
  24. 0/2 read-cache: do not trust a size change when conversion is activetboegi@web.de, Nov 27, 2026
  25. Junio C HamanoNov 28, 2026
  26. 1/2 read-cache: do not trust a size change when conversion is activetboegi@web.de, Nov 27, 2026
  27. Junio C HamanoNov 28, 2026
  28. Torsten BögershausenNov 28, 2026
  29. Junio C HamanoNov 29, 2026
  30. 2/2 read-cache: optimize file size change when conversion is activetboegi@web.de, Nov 27, 2026
  31. Junio C HamanoNov 28, 2026
  32. 1/1 read-cache: do not trust a size change when conversion is activetboegi@web.de, Nov 29, 2026
  33. Junio C HamanoNov 29, 2026
  34. Junio C HamanoNov 29, 2026
  35. Junio C HamanoNov 29, 2026
  36. Torsten BögershausenNov 29, 2026
  37. Junio C HamanoNov 29, 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.