Git development
 help / color / mirror / Atom feed
From: tboegi@web.de
To: tboegi@web.de, git@vger.kernel.org, curtis.allen.smith@gmail.com
Subject: [PATCH/RESEND v6 0/2] read-cache: do not trust a size change when conversion is active
Date: Fri, 27 Nov 2026 20:42:33 +0100	[thread overview]
Message-ID: <20261127194233.10069-1-tboegi@web.de> (raw)
In-Reply-To: <xmqqwm1no29m.fsf@gitster.g>

From: Torsten Bögershausen <tboegi@web.de>

This patch series was stalled, it seems.
As agreed in the coooking thread:
Lets try to move things forward, here comes my simplified summary:

When `git status` is run, git runs a lstat() on all files that are
tracked.
When all relevant fields of "struct stat" are the same
as recorded in the index, the file is unchanged.

a) If mtime is changed, git must check if the file contents give
   the same blob (hash value) in the index.
b) If mtime is close to mtime of the index file itself,
   we can not trust ctime and the check is done as well (racy)
c) And there is a "shortcut":
   When a file has a different size on disk compared to what is recorded
   in the index, it -must- have a different content.
   However, ever since line ending conversions (CRLF -> LF) and input filters
   had been introduced, this assumption is no longer true.
   The file on disk must be converted
   (into the content that the next commit will have in the next commit)
   and re-hashed.
   And this is what the patch series is about.
   The short cut (different size -> different content)
   is removed for regular files.
   It is kept for for links, they don't undergo a conversion.

Patch 1 does the basic work and adds test cases.
Patch 2 optimizes and updates the comments in read-cache.c

Comments welcome.

Curtis Allen Smith (1):
  read-cache: do not trust a size change when conversion is active

Torsten Bögershausen (1):
  read-cache: optimize file size change when conversion is active

 read-cache.c    | 17 ++++++++---------
 t/t0020-crlf.sh | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 9 deletions(-)

-- 
2.56.0.236.g7e34d8174d


  parent reply	other threads:[~2026-11-27 19:42 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-11 19:51 [PATCH v2 1/2] utf8.c: Prepare workaround for iconv under macOS 14/15 tboegi
2026-01-12  4:58 ` Junio C Hamano
2026-01-12 16:25   ` [PATCH v3 0/2] Workaround " tboegi
2026-01-12 16:25   ` [PATCH v3 1/2] utf8.c: Prepare workaround " tboegi
2026-01-12 16:25   ` [PATCH v3 2/2] utf8.c: Enable " tboegi
2026-10-12 17:56   ` [PATCH v3/RFC 0/1] read-cache: do not trust a size change when conversion tboegi
2026-10-12 17:56   ` [PATCH v3/RFC 1/1] read-cache: do not trust a size change when conversion is active tboegi
2026-10-12 19:11     ` Junio C Hamano
2026-10-13  1:29       ` Junio C Hamano
2026-10-13  6:45         ` Curtis Smith
2026-10-13  5:34     ` Johannes Sixt
2026-10-13  6:48       ` Curtis Smith
2026-10-13  6:58     ` [PATCH v4] " Curtis Allen Smith
2026-10-13  9:44       ` Phillip Wood
2026-10-13 17:57         ` Curtis Smith
2026-10-13 18:01       ` Torsten Bögershausen
2026-10-13 18:02       ` [PATCH v5] " Curtis Allen Smith
2026-10-13 20:29         ` Junio C Hamano
2026-10-18 11:18           ` Torsten Bögershausen
2026-10-19  5:57             ` Junio C Hamano
2026-10-20 20:56         ` Torsten Bögershausen
2026-10-26 19:25   ` [PATCH/RFC 0/1] More cs/read-cache-conversion-size tboegi
2026-10-26 19:25   ` [PATCH/RFC 1/1] read-cache: optimize file size change when conversion is active tboegi
2026-11-27 19:42   ` tboegi [this message]
2026-11-28  4:09     ` [PATCH/RESEND v6 0/2] read-cache: do not trust a " Junio C Hamano
2026-11-27 19:42   ` [PATCH/RESEND v6 1/2] " tboegi
2026-11-28  3:28     ` Junio C Hamano
2026-11-28  7:38       ` Torsten Bögershausen
2026-11-29 17:44         ` Junio C Hamano
2026-11-27 19:42   ` [PATCH/RESEND v6 2/2] read-cache: optimize file " tboegi
2026-11-28  3:38     ` Junio C Hamano
2026-11-29 15:28   ` [PATCH v7 1/1] read-cache: do not trust a " tboegi
2026-11-29 20:13     ` Junio C Hamano
2026-11-29 21:53       ` Junio C Hamano
2026-11-29 20:18     ` Junio C Hamano
2026-11-29 22:05       ` Torsten Bögershausen
2026-11-29 22:10         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261127194233.10069-1-tboegi@web.de \
    --to=tboegi@web.de \
    --cc=curtis.allen.smith@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox