Re: [PATCH v2 4/6] odb/source-files: simplify directory duplication detection
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Oct 27, 2026, 12:13 UTC
- Message-ID
- <CAP8UFD12rSyCh9xhfcggvL4nh30KyWSZhGWrLVmVa051KaJdpg@mail.gmail.com>
- 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 <ps@pks.im> wrote:
Show 15 quoted lines
> -/* > - * 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.
Show 9 quoted lines
> @@ -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 directorys/map/set/
Show 11 quoted lines
> + * 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.