From cf711d475ce99e99cf395f99f96a05e111875a45 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Thu, 9 Jan 2025 17:40:42 +0100 Subject: [PATCH] scalar: set feature.manyFiles=true Make scalar set features.manyFiles, so that it takes advantage of the settings that manyFiles applies. In particular, index.skipHash was being set to false in scalar, due to a mistake in commit 17194b195d (features: feature.manyFiles implies fast index writes), which was meant to enable it and instead set it to false. With this change, the platform-specific choice of the core.untrackedCache setting that was set by scalar, is also moved to manyFiles. Signed-off-by: Henrique Ferreiro --- repo-settings.c | 16 ++++++++++++++++ scalar.c | 21 +-------------------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/repo-settings.c b/repo-settings.c index 195c24e9c07606..11d2c75a908d5e 100644 --- a/repo-settings.c +++ b/repo-settings.c @@ -59,7 +59,23 @@ void prepare_repo_settings(struct repository *r) if (manyfiles) { r->settings.index_version = 4; r->settings.index_skip_hash = 1; +#ifndef WIN32 r->settings.core_untracked_cache = UNTRACKED_CACHE_WRITE; +#else + /* + * Unfortunately, Scalar's Functional Tests demonstrated + * that the untracked cache feature is unreliable on Windows + * (which is a bummer because that platform would benefit the + * most from it). For some reason, freshly created files seem + * not to update the directory's `lastModified` time + * immediately, but the untracked cache would need to rely on + * that. + * + * Therefore, with a sad heart, we disable this very useful + * feature on Windows. + */ + r->settings.core_untracked_cache = UNTRACKED_CACHE_REMOVE; +#endif r->settings.pack_use_path_walk = 1; } diff --git a/scalar.c b/scalar.c index 2aeb191cc89b72..a45a258eca2200 100644 --- a/scalar.c +++ b/scalar.c @@ -127,37 +127,18 @@ static int set_recommended_config(int reconfigure) { "core.FSCache", "true", 1 }, { "core.multiPackIndex", "true", 1 }, { "core.preloadIndex", "true", 1 }, -#ifndef WIN32 - { "core.untrackedCache", "true", 1 }, -#else - /* - * Unfortunately, Scalar's Functional Tests demonstrated - * that the untracked cache feature is unreliable on Windows - * (which is a bummer because that platform would benefit the - * most from it). For some reason, freshly created files seem - * not to update the directory's `lastModified` time - * immediately, but the untracked cache would need to rely on - * that. - * - * Therefore, with a sad heart, we disable this very useful - * feature on Windows. - */ - { "core.untrackedCache", "false", 1 }, -#endif { "core.logAllRefUpdates", "true", 1 }, { "credential.https://dev.azure.com.useHttpPath", "true", 1 }, { "credential.validate", "false", 1 }, /* GCM4W-only */ { "gc.auto", "0", 1 }, { "gui.GCWarning", "false", 1 }, - { "index.skipHash", "false", 1 }, { "index.threads", "true", 1 }, - { "index.version", "4", 1 }, { "merge.stat", "false", 1 }, { "merge.renames", "true", 1 }, { "pack.useBitmaps", "false", 1 }, { "pack.useSparse", "true", 1 }, { "receive.autoGC", "false", 1 }, - { "feature.manyFiles", "false", 1 }, + { "feature.manyFiles", "true", 1 }, { "feature.experimental", "false", 1 }, { "fetch.unpackLimit", "1", 1 }, { "fetch.writeCommitGraph", "false", 1 },