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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 9, 2026, 05:37 UTC
Message-ID
<xmqqfqyfwi20.fsf@gitster.g>
In-Reply-To
<20261008204603.1988-2-curtis.allen.smith@gmail.com>
Curtis Allen Smith <curtis.allen.smith@gmail.com> writes:
Show 6 quoted lines
> "git status" can report a file as modified while "git diff" and
> ...
> next run of the tool flags everything again.
>
> Signed-off-by: Curtis Allen Smith <curtis.allen.smith@gmail.com>
> ---
That's overly verbose.
>  read-cache.c    | 129 ++++++++++++++++++++++++++++++++++++++++++++++--
>  t/t0020-crlf.sh |  45 +++++++++++++++++
>  2 files changed, 171 insertions(+), 3 deletions(-)

And it is curious why we need so much new code, especially after reading an explaination in the proposed log message that makes it sound as if "we let ce_modified_check_fs() to compare converted result already when timestamps differ, and it is just the matter of doing the same when sizes are the same" is what is happening in the patch. Why do we need to add a new function that compares converted data? A new function is not automatically a bad thing. If there is already an existing code path that does the same thing, a new function may be a good way to replace that code path with a more generic code and apply essentially the same logic implemented by that new more generic code to a new code path. But in such a refactoring patch, we usually see a comparable number of removed lines, which is not what we see in the diffstat above.

Previous: Curtis Allen SmithNext: Curtis Allen Smith
Message 3 of 4 in “status: agree with diff and add when conversion is active”
  1. 0/2 status: agree with diff and add when conversion is activeCurtis Allen Smith, Oct 8, 2026
  2. 1/2 read-cache: do not trust a size change when conversion is activeCurtis Allen Smith, Oct 8, 2026
  3. Junio C HamanoOct 9, 2026
  4. 2/2 core: add core.convertAwareStatus to opt out of the content checkCurtis Allen Smith, Oct 8, 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.