Re: [PATCH v2 1/4] odb: decouple source path comparisons from `the_repository`
Patrick Steinhardt <[email protected]>
| Newsgroups | org.kernel.vger.git |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Aug 17, 2026 at 03:36:21AM -0400, Jeff King wrote: > On Mon, Aug 17, 2026 at 09:16:53AM +0200, Patrick Steinhardt wrote: > > > > So if we want to go down this path I'm inclined to just unconditionally > > > use case sensitive matching and not introduce any secondary machinery. > > > > Thinking about this a bit more: I'd suggest that we leave this out of > > this patch and instead document this as a NEEDSWORK area for now. I > > _think_ that this proposed refactoring should be generally fine, and I > > quite like the simplification that results from it. But the risk for > > regression is quite a bit higher compared to the origanal patch that > > I've proposed. > > OK. The inline lookup of core.ignoreCase feels quite gross to me, but > it's _probably_ OK. > > There are all kinds of weird timing issues lurking with config lookup, > though. In particular you cache the result in o->source_paths_icase. But > would we ever load odb source paths before the repo is fully loaded into > memory (or in the case of clone, even fully formed on disk)? In that > case we'd cache the wrong value forever. Good callout, there's one gotcha here that I was already fixing in a subsequent patch series. Namely, we call `create_object_directory()` before we set "core.sharedRepository" in `init_db()`. But in all the other cases we should be fine. I'll cherry-pick that patch into this series. > I think we have repo_ignore_case() now, since e6a79c9eb8 (config: use > repo_ignore_case() to access core.ignorecase, 2026-06-19). That's in > 'master', so it might be worth building on that instead. And then if > there's any cache invalidation to do, it would eventually happen there. We can't use that one though, as it uses `repo_config_values()`, and that function only works with `the_repository`. So that'd break with submodule repositories. Patrick