From: Christian Couder Date: Tue, 27 Oct 2026 12:13:49 GMT Subject: Re: [PATCH v2 4/6] odb/source-files: simplify directory duplication detection Message-ID: In-Reply-To: <20261023-pks-odb-files-reload-alternates-v2-4-30559d7ff43b@pks.im> On Fri, Oct 23, 2026 at 2:48 PM Patrick Steinhardt wrote: > -/* > - * NEEDSWORK: we're using "core.ignoreCase" to deduplicate alternates that > - * _may_ be the same. This requires quite a bit of boilerplate for dubious > - * benefit: > - * > - * - Duplicating alternates should really only lead to regressed performance. > - * > - * - We don't properly resolve symlinks or mointpoints, so we may still end > - * up duplicating alternates. > - * > - * - The value may be lying, in which case we might deduplicate alternates > - * that are in fact not mapping to the same directory. > - * > - * We should investigate whether we can remove this whole mechanism outright. > - */ Removing this NEEDSWORK isn't mentioned in the commit message. I agree that the boilerplate is reduced with the new implementation, but I think the points regarding mount points and a wrong `core.ignoreCase` might still be interesting. > @@ -55,17 +50,17 @@ struct odb_source_files { > struct odb_files_dir **dirs_tail; > > /* > - * Map of object directories, keyed by their respective paths. This > - * map is used to detect the case where the same directory is > - * registered multiple times. > + * Set of directory paths that have already been linked into this > + * source. This map is used to detect the case where the same directory s/map/set/ > + * is registered multiple times. > */ > - struct hashmap dirs_by_path; > + struct strset dir_paths; > > /* > * Whether directory paths shall be compared case-insensitively, as > * determined by "core.ignoreCase". > */ > - int dirs_paths_icase; > + int dir_paths_icase; Nit: I guess this is to match the name of the strset, but it could have been mentioned in the commit message.