# Revived read-cache patch would stop trusting size changes when a clean filter applies

_The patch targets a mismatch where git status reports a file as modified while git diff and git add, which run the clean filter, agree it is unchanged._

Section: Patches. Edition of 2026-10-13. Written by an AI editor from the thread "[PATCH v2 1/2] utf8.c: Prepare workaround for iconv under macOS 14/15" (23 messages): https://gitlist.dev/t/64776

Although the thread subject refers to an iconv workaround for macOS, the messages excerpted concern a read-cache change. The problem is that "git status" can show a file as modified while "git diff" and "git add", which run the clean filter, find its contents unchanged. The commit message reproduces this with a repository where `* text eol=lf` is set and a file is rewritten with CRLF line endings. Status shows it as modified, diff is empty, and add updates the index. It says tools that rewrite files can trigger this.

The patch, "read-cache: do not trust a size change when conversion is active", changes read-cache.c by about 25 lines and adds 45 lines of tests to t0020-crlf.sh. In a cover note Bögershausen says he picked up Curtis Allen Smith's patch, reduced the commit message and the code changes, and removed the original series' configuration switch. He says all tests pass for him and that the commit message still feels bumpy. He has added a Signed-off-by for Smith and asks if that is acceptable, calling this version not final.

Junio Hamano asked for confirmation that Bögershausen and Smith are working together. He said private collaboration is fine but invisible to others, and he wanted to be sure the topic was not being taken over unilaterally. He added that his mailer discards Git-related messages sent only to him without a Cc to the list. He suggested a Co-authored-by trailer might be appropriate once the series leaves RFC status.

On the technical side, Hamano questioned phrases such as "in real life" and "back and forth", noting that such rewrites change contents as well as size. He found the code surprisingly simple but asked how much overhead the attribute lookup adds when no clean filter is involved. Those points were open at the time of the excerpts.
