Thread View: linux.kernel.git
2 messages
2 total messages
Started by Junio C Hamano
Sat, 28 Nov 2026 03:28
Re: [PATCH/RESEND v6 1/2] read-cache: do not trust a size change when conversion is active
Author: Junio C Hamano
Date: Sat, 28 Nov 2026 03:28
Date: Sat, 28 Nov 2026 03:28
69 lines
15574 bytes
15574 bytes
tboegi@web.de writes: > Helped-by: Torsten Bögershausen <tboegi@web.de> > Signed-off-by: Curtis Allen Smith <curtis.allen.smith@gmail.com> > Signed-off-by: Junio C Hamano <gitster@pobox.com> > Signed-off-by: Torsten Bögershausen <tboegi@web.de> > --- I would have pretended that the patch was relayed directly from the list message by omitting my sign-off from the list if I were you, but I presume that the above accurately records the chain of custody by stating that you did not pick up Curtis's message from the list but picked up the copy I queued to my tree (and later got timed out). What we see above is not wrong, but I do not know if the distinction matters. > read-cache.c | 4 +++- > t/t0020-crlf.sh | 39 +++++++++++++++++++++++++++++++++++++++ > 2 files changed, 42 insertions(+), 1 deletion(-) > > diff --git a/read-cache.c b/read-cache.c > index c4cf08a3a3..70f4787de9 100644 > --- a/read-cache.c > +++ b/read-cache.c > @@ -9,6 +9,7 @@ > > #include "git-compat-util.h" > #include "config.h" > +#include "convert.h" > #include "date.h" > #include "diff.h" > #include "diffcore.h" > @@ -480,7 +481,8 @@ int ie_modified(struct index_state *istate, > */ > (!S_ISLNK(st->st_mode) || ce->ce_stat_data.sd_size != MAX_PATH) && > #endif > - (S_ISGITLINK(ce->ce_mode) || ce->ce_stat_data.sd_size != 0)) > + (S_ISGITLINK(ce->ce_mode) || ce->ce_stat_data.sd_size != 0) && > + !(S_ISREG(st->st_mode) && would_convert_to_git(istate, ce->name))) > return changed; > > changed_fs = ce_modified_check_fs(istate, ce, st); Keeping this check in ie_modified() rather than ie_match_stat() is the right call, I think. Because preload_index() calls ie_match_stat() from worker threads with CE_MATCH_RACY_IS_DIRTY, attribute lookups must not run there. In contrast, none of the callers of ie_modified() (refresh_cache_ent(), builtin/ls-files.c, builtin/mv.c, and is_staging_gitmodules_ok() in submodule.c) pass CE_MATCH_RACY_IS_DIRTY. When a regular file's size changes and would_convert_to_git() returns true (covering clean filters, working-tree-encoding, CRLF conversion, and ident), ie_modified() falls through to ce_modified_check_fs(), which calls ce_compare_data() and index_fd() to convert and hash the file. If the resulting object name matches the index entry, ie_modified() returns 0 and refresh_cache_ent() calls fill_stat_cache_info() to update the cached stat data, so subsequent runs match on lstat(2) alone. Files without conversion still take the fast early return on size mismatch. OK. It might be worth adding a bit to the comment above this conditional in ie_modified() to explain why DATA_CHANGED is ignored when conversion is active on a regular file, since the existing comment only mentions a zero '.sd_size' after read-tree or update-index. Thanks.
Re: [PATCH/RESEND v6 1/2] read-cache: do not trust a size change when conversion is active
Author: Junio C Hamano
Date: Sun, 29 Nov 2026 17:44
Date: Sun, 29 Nov 2026 17:44
33 lines
14175 bytes
14175 bytes
Torsten Bögershausen <tboegi@web.de> writes: > On Fri, Nov 27, 2026 at 07:28:57PM -0800, Junio C Hamano wrote: >> tboegi@web.de writes: >> >> > Helped-by: Torsten Bögershausen <tboegi@web.de> >> > Signed-off-by: Curtis Allen Smith <curtis.allen.smith@gmail.com> >> > Signed-off-by: Junio C Hamano <gitster@pobox.com> >> > Signed-off-by: Torsten Bögershausen <tboegi@web.de> >> > --- >> >> I would have pretended that the patch was relayed directly from the list >> message by omitting my sign-off from the list if I were you, but I >> presume that the above accurately records the chain of custody by >> stating that you did not pick up Curtis's message from the list but >> picked up the copy I queued to my tree (and later got timed out). What >> we see above is not wrong, but I do not know if the distinction matters. >> > > As a side note: There was no LLM involved, just an overloaded > HI (Human Inteligence). I understand that this [1/2] step were simply relayed without rewriting what Curtis originally sent. I did not think it was your LLM, but I do not know how Cutris came up with the log message. > While probably the resulting code is in a good shape, > I take the challange to come up with a good commit message. > > Thanks for the review, Junio. Thanks. I may have already said, but I am reasonably happy with [1/2].
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads