Article View: linux.kernel.git
Article #382Re: [PATCH v3/RFC 1/1] read-cache: do not trust a size change when conversion is active
From: Johannes Sixt
Date: Tue, 13 Oct 2026 05:34
Date: Tue, 13 Oct 2026 05:34
31 lines
6154 bytes
6154 bytes
Am 12.10.26 um 19:56 schrieb tboegi@web.de: > @@ -438,6 +439,27 @@ int ie_match_stat(struct index_state *istate, > return changed; > } > > +/* > + * A difference between the size of the file in the working tree and the > + * size recorded for it in the index proves that the contents changed > + * only as long as the two are byte-for-byte comparable. That stops > + * being true as soon as the path is run through a clean filter: I cannot agree with this reasoning. The index is a cache of the stat information. The size recorded in the index is only used as a clue whether the file was changed or not. It does *not* record the size of the data that the object database holds for the blob. If your analysis found that, after the content was `git add`-ed, the size in the index is *not* identical to the size taken from the filesystem, then the problem is that an incorrect size was put into the index, and not that the size between the blob data in the database and the filesystem's file are different (and unusable). > + * rewriting a file with CRLF endings under "text eol=lf", for example, > + * changes its size in the working tree without changing the blob Git > + * would record for it. For such a path the only way to tell is to read > + * the contents and convert them, which is what we already do when only > + * the mtime changed. > + */ -- Hannes
Technical Details
Message-ID:
<3b36c428-6d67-45ef-9f6f-e78da33646ac@kdbg.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-71814-linux-kernel-git=dewy.ruReferences:
<xmqqwm1no29m.fsf@gitster.g> <20261012175638.3712-1-tboegi@web.de>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-71814-linux-kernel-git=dewy.ru From: j6t@kdbg.org (Johannes Sixt) Newsgroups: linux.kernel.git Subject: Re: [PATCH v3/RFC 1/1] read-cache: do not trust a size change when conversion is active Date: Tue, 13 Oct 2026 07:34:24 +0200 Organization: Usenet Network Message-ID: <3b36c428-6d67-45ef-9f6f-e78da33646ac@kdbg.org> References: <xmqqwm1no29m.fsf@gitster.g> <20261012175638.3712-1-tboegi@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="1976084"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Cu4vg/EnwP6XYs+FSuFjX3edjj4= sha256:L5dDhZblU/V4hkjAlxwpgcayjsGeOmMHg6o3nnlv3P4= sha1:FiSeZeOz9VRlPYSSReOg1AfK7FM= sha256:gpIRL+0N9vZuTlnpvPU36BwMiyk2A77cQfb3Q5UcEjU= Content-Language: en-US List-ID: <git.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id B696110FD89; Tue, 13 Oct 2026 09:27:10 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: 0.449 X-Spam-Status: No, score=0.449 tagged_above=-9999 required=6.31 tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=no autolearn_force=no X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g0L9s4exT3Co; Tue, 13 Oct 2026 09:27:07 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-71814-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=kdbg.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 33A6A10FD86; Tue, 13 Oct 2026 09:27:03 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 45DF7396BF; Tue, 13 Oct 2026 06:21:45 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43CB04B04A5; Tue, 13 Oct 2026 06:21:44 +0000 (UTC) X-Received: from bsmtp5.bon.at (bsmtp5.bon.at [195.3.86.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88321477287 for <git@vger.kernel.org>; Tue, 13 Oct 2026 06:21:41 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.3.86.187 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791872503; cv=none; b=DoCj3Fy2KZCiL6z9zLXIRcXNo5cmZb3bD+2yHKwTnf/eErNgoNdYM5XZL2NyTeshZ0qRgysPdG10M365HRvfQs5DvQR9gBDBk5hfdTw5XcVn8xHKS5iGWH6RibT+KrNSNGJ/iw1tsKf5cR0enzsRTSsMGVuNnLq5Eqt6PSvUPoc= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791872503; c=relaxed/simple; bh=MBbAnf0F7nPWHuzKeXU+thGfXoCo/RumBp0LXBxg9qM=; h=Message-ID:Date:MIME-Version:Subject:To:References:From:Cc: In-Reply-To:Content-Type; b=Kq9tBmYoCJOmUCsGr+vBVUbnxh/qs3vtNFZVKJZ6cokga8fMXakae23ahjY1YCaCrv+7Dkm4mTXEVRiy03qrfheArDvn/Ys9x/Pme4dCT3Xlr9BE4GeH+sjWfsa1onybWk07kt8QThUS0kHiZeLJdhlQB8Fk/lBm3NF7FjV7gBA= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kdbg.org; spf=pass smtp.mailfrom=kdbg.org; arc=none smtp.client-ip=195.3.86.187 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kdbg.org X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kdbg.org X-Received: from bsmtp2.bon.at (unknown [192.168.181.106]) by bsmtp5.bon.at (Postfix) with ESMTPS id 4j3jhB0HCmz7Qv0K for <git@vger.kernel.org>; Tue, 13 Oct 2026 07:34:34 +0200 (CEST) X-Received: from [192.168.0.100] (unknown [93.83.142.38]) by bsmtp2.bon.at (Postfix) with ESMTPSA id 4j3jh05jb0zRnlS; Tue, 13 Oct 2026 07:34:24 +0200 (CEST) X-Precedence: bulk X-Mailing-List: git@vger.kernel.org X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org> X-User-Agent: Mozilla Thunderbird X-Cc: git@vger.kernel.org, curtis.allen.smith@gmail.com X-In-Reply-To: <20261012175638.3712-1-tboegi@web.de>