From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout.web.de (mout.web.de [217.72.192.78]) (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 E92863C9EF3 for ; Sun, 11 Oct 2026 06:57:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.72.192.78 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791701864; cv=none; b=jag0vfzBf4WJkSncUid9qBr+DxNs0lavfHt3OgbNTWvIBE0DUS//3GOweIKGtxpbKjgzrRdh5kV6MvXsEPBQ3xgKwc5svjpCILjLwMUa3zXIfdLGA9nhHe0G+UnbA0/8j4O+BimEhpz9uXXvL2ewMh1yaPSb/Y2j0gCWk+7TNxY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791701864; c=relaxed/simple; bh=n8sJRFYmln29ZkyOIzcc1+A4eO8W4unujYxErYi1EKE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=L7yBGWR9y1LSgervNXchz3cQhB3Dx55bMEuaEz2McOg46vCNd5wSoQtcj+KlUdrI/goH0TktWS2YOAkGq/HtR39woQKsZIQltsyIM/BBWm/8lPNf3qUSkwyg5gM3Q3yxr3gc3qZlcp1Uk37XESO6UZRnAlJ7a13zKUy05y2mxg0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=tboegi@web.de header.b=QOqd8Xn5; arc=none smtp.client-ip=217.72.192.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=tboegi@web.de header.b="QOqd8Xn5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1791701859; x=1792306659; i=tboegi@web.de; bh=9k3NuSgw3iaOPX6uo4A1FazEhs9TNrDLKmSscluzCjw=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To:Content-Transfer-Encoding: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=QOqd8Xn5vjWcaOkG3BTz+WbobaVnRhkeZpXTAEfyEyZM1Gr6mcQMzbK6JoUu+xDn O0s3xl+0hQHlM9cUF4/VQ96TU8fGycGm81CTkD6nyhmTlBNmXQ89YFzwKXf07UUbO l8hsUMSTrjrUt2+z1E1WkTgL5RXrdhEOQ1XC0nRa9oSVZ8/0x5b74gdmBcPsT+8WX dqXgxc/O3sD5pEhFfTrAHPxS5dE/s2nKX45Fm7SelMS/AaYXObq86bWyZvLuld7jZ +DqhszegRiuqc9M/VXGbUpwyYJlneXgpGsPDjNzIA3Y9XqQ3sxQGMHUMNMk612qqa 7vNiD9EkkqBQy1E9bA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from client.hidden.invalid by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M59nK-1xGtxn1hMC-001f2z; Sun, 11 Oct 2026 08:57:39 +0200 Date: Sun, 11 Oct 2026 08:57:38 +0200 From: Torsten =?iso-8859-1?Q?B=F6gershausen?= To: Curtis Allen Smith Cc: git@vger.kernel.org Subject: Re: [PATCH 1/2] read-cache: do not trust a size change when conversion is active Message-ID: <20261011065738.GA1873@tb-raspi4> References: <20261008204603.1988-1-curtis.allen.smith@gmail.com> <20261008204603.1988-2-curtis.allen.smith@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261008204603.1988-2-curtis.allen.smith@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Provags-ID: V03:K1:6EwBHGc0zmgtHRZimmjjtntfW5XNSOeusU+GIKkZ+hkealqdDL9 /nhxMldtRhgpzXp+noVSjwpfnMjQWzICI9wjxWW3J1Fw8lJf/AYkCg1D7DAAL+Gmv2zy1fh WpuBp4xdQ88ck8kmOpPh/j45WrRX08lj1WWLSjO8hzFg19BhD4RJy43VjrKYRJIE/qux5f1 aJWNW2SyCoT8sskEKYvfg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:k2uW72ivOj4=;bHJRmulOCURZk42DdIosfRomH8n blH87Q4vmqy+HKnwYAoc5JPlCTA9/MSKjvR0kWU2qazin/PmLLf+yr4qsVnFXjArnH4qk9p1O 2e74WboD1U5q7V0LPd+J+6xCEngmYhzybV4guxaYygQn3SlEnJ0eF9ZjXRTU8Ta0nqdl1vYUq VRKarkKndR9akdHLaFnDTmEnJkKh98buuXWVUh5IqFBEdePMGoMsoDJNsQL31CUQkcHjHSWWX ANBl6k11pTJGpYY0thS5R3L7BVJVeGvI9ZaB+f/Zm4rDljPqVO2osTGeP+ekDR77uJ5KgK5Bf 0bbopiXmBywf5wUh04VtlCf0OnYafa+0DPee0ictAR7UxT8K8Kqh1e/+IxfyU5cJAeTX7wncb KFcdds1jmalL0V1Ads5X9/I96JV/Xjo1nIKnHL5Zh8hM1FCWmUWERBDpbUDSOK4JSGpVzptCY QoL4SDi0vnl3PlMm5magj9N6KfL2BqBbBjIYvP2fIgcECR0OoQS9djOguNnNL83J9qR0G9YJX ufQdefvtha4YTmTn90hg7TmvaiQKEM6SXATvf3TNcF9pjzATpIqnuf4egjroy48g3eEKXIBm1 eKqN5w7meooEZTx+sglki4LteH0VwAznHiyq2WQQwtQj5wGpGNeNj9BP65YkQ6g/KoOxSk/JY fUJ/oyRg49p1N035BQfAu1SDF6iP2fNxQYbeD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eEMdiiJIjXmKoXGLCb2jWV0MedMbXzeIVxfe8ZgBkFIhc4PEez LQkd3+Tsx2kOpZbYxu6D9A2IkH/YwjTWNH/rY/x00XFdCpbYm7v/Sbmi9Ykj0YYQzuk9xF2n9 jBrH4qutf4KEOeyR6McQuCyDi0U1DC4RX/8iCVH1A8F9rcBIWxhuwK540h6lEgQ0R86jrC1Kf 0FO2172JaSjtN6zMBNtsn9atytAORWNY56t2NxFy9ZT4/IZrpsU+vtEdissxdPLTzugSGJhfF 61Tv0wh7tFSGg6JKIfxLWk3QykNnz7oa0xKXXBkxJJipgKzeGRSuLtCgFLov/hjfwiwOOOlTq d0k7nStuHxRN/rOSD+ZkPeDhWjlj2fQxMGhWquKobQl5+xfpr3RR79DXMjS0qLe7cRJmBV6cU wo4gEra0W1OqjboATgWFqbG/vHRyPJ8vHl4XOFlEp8ExiKX7zoioj6GgFD9eydTN4zZLpwf4G LwHU/eRxc7sjs9V7GUfVKtm0yUuUwCk8nJ3Uhc6qt5j4B5o= Content-Transfer-Encoding: quoted-printable On 2026-10-08 22:45, Curtis Allen Smith wrote: Disclaimer: My comments may be hard to read - they are intended to be helpfull, but I struggled with my email-prgrams here. > "git status", "git diff" and "git add" can disagree about whether a > file has been modified. Under >=20 > * text eol=3Dlf >=20 > a tool that rewrites an otherwise unchanged file with CRLF endings > makes "git status" report it as modified, while "git diff" shows > nothing and "git add" stages nothing [snip] Nit:... stages nothing to be committed. It does update the index, since the length of the file in the working tree has changed. `git add` runs the clean filter, the working tree encoding, CRLF conversion and the "indent" filter, if specified for a file. [snip] > That contradiction, rather than the line endings as such, is what > this series is about. good >=20 > The cause is the size comparison in ie_match_stat(). ie_modified() > takes a difference between the file's size and the size recorded in > the index as proof of a content change and returns without reading > the file. [snip] The following can be shortened, but I don't have a good suggestion yet. > The mtime branch of the very same function already reads > the file and applies the conversion before deciding, so Git pays for ski= p "Git pays" ? May be: does the correct thing. > the conversion-aware check in one branch and refuses to in the other. >=20 > Patch 1 makes the size branch behave like the mtime branch whenever > the path is subject to conversion. Paths with no conversion take the > existing early return untouched. It also stops ce_compare_data() > hashing a file whose converted length already differs from the size > of its blob, since equal contents must have equal length; that is > where most of the cost of the new check would otherwise go, and it > helps the pre-existing mtime path as well. When the end-of-line > conversion is the only one that applies, that length comes from a > scan for CR, and the file is not converted either. Skip the rest: I don't think that an option turning this feature off is needed. Users which don't use CRLF conversion or any clean filters are not affected by this path - or did I miss something ? Users which use filters and/or CRLF should probably get the correct answer from `git status`. And yes, I think that this has happened to me as well - in my case a tool insisting to replace 4 spaces with a TAB combined with a clean filter that converted TAB into 4 spaces. `git status` and `git diff` didn't agree, and I was never able to find out why. [snip] > This was reported against Git for Windows [1], where Torsten suggested > bringing it to the list. It is not Windows-specific; anything with a > clean filter runs into it, and Git LFS users on Linux see the same > contradiction. Yes. >=20 > Built with gcc 15.2 on top of 6de20f6; each commit builds and passes > on its own. t0020 (with the new tests), t0021, t0026, t0027, t1300, > t2106, t2200, t3700, t7508 and t0008 pass. >=20 > [1] https://github.com/git-for-windows/git/issues/6410 I didn't dig deep into the code yet - that's for the future. Thanks for working on this.