Skip to content

Commit 8783db6

Browse files
committed
scalar: remove stale config values
These config values were added in the original Scalar contribution, d0feac4 (scalar: 'register' sets recommended config and starts maintenance, 2021-12-03), but were never fully checked for validity in the upstream Git project. At the time, Scalar was only intended for the contrib/ directory so did not have as rigorous of an investigation. Each config option has its own justification for removal: * core.preloadIndex: This value is true by default, now. Removing this causes some changes required to the tests that checked this config value. Use gui.gcwarning=false instead. * core.fscache: This config does not exist in the core Git project, but is instead a config option for a Git for Windows feature. * core.multiPackIndex: This config value is now enabled by default, so does not need to be called out specifically. It was originally included to make sure the background maintenance that created multi-pack-indexes would result in the expected performance improvements. * credential.validate: This option is not something specific to Git but instead an older version of Git Credential Manager for Windows. That software was replaced several years ago by the cross-platform Git Credential Manger so this option is no longer needed to help users who were on that older software. * pack.useSparse=true: This value is now Git's default as of de3a864 (config: set pack.useSparse=true by default, 2020-03-20) so we don't need it set by Scalar. Signed-off-by: Derrick Stolee <stolee@gmail.com>
1 parent 10e9548 commit 8783db6

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

scalar.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ static int set_recommended_config(int reconfigure)
135135
struct scalar_config config[] = {
136136
/* Required */
137137
{ "am.keepCR", "true", 1 },
138-
{ "core.FSCache", "true", 1 },
139-
{ "core.multiPackIndex", "true", 1 },
140-
{ "core.preloadIndex", "true", 1 },
141138
#ifndef WIN32
142139
{ "core.untrackedCache", "true", 1 },
143140
#else
@@ -157,7 +154,6 @@ static int set_recommended_config(int reconfigure)
157154
#endif
158155
{ "core.logAllRefUpdates", "true", 1 },
159156
{ "credential.https://dev.azure.com.useHttpPath", "true", 1 },
160-
{ "credential.validate", "false", 1 }, /* GCM4W-only */
161157
{ "gc.auto", "0", 1 },
162158
{ "gui.GCWarning", "false", 1 },
163159
{ "index.skipHash", "true", 1 },
@@ -166,7 +162,6 @@ static int set_recommended_config(int reconfigure)
166162
{ "merge.stat", "false", 1 },
167163
{ "merge.renames", "true", 1 },
168164
{ "pack.useBitmaps", "false", 1 },
169-
{ "pack.useSparse", "true", 1 },
170165
{ "receive.autoGC", "false", 1 },
171166
{ "feature.manyFiles", "false", 1 },
172167
{ "feature.experimental", "false", 1 },

t/t9210-scalar.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,15 @@ test_expect_success 'scalar clone --no-... opts' '
202202
test_expect_success 'scalar reconfigure' '
203203
git init one/src &&
204204
scalar register one &&
205-
git -C one/src config core.preloadIndex false &&
205+
git -C one/src config unset gui.gcwarning &&
206206
scalar reconfigure one &&
207-
test true = "$(git -C one/src config core.preloadIndex)" &&
208-
git -C one/src config core.preloadIndex false &&
207+
test false = "$(git -C one/src config gui.gcwarning)" &&
208+
git -C one/src config unset gui.gcwarning &&
209209
rm one/src/cron.txt &&
210210
GIT_TRACE2_EVENT="$(pwd)/reconfigure" scalar reconfigure -a &&
211211
test_path_is_file one/src/cron.txt &&
212-
test true = "$(git -C one/src config core.preloadIndex)" &&
213-
test_grep "preloadIndex = true # set by scalar" one/src/.git/config &&
212+
test false = "$(git -C one/src config gui.gcwarning)" &&
213+
test_grep "GCWarning = false # set by scalar" one/src/.git/config &&
214214
test_grep "excludeDecoration = refs/prefetch/\* # set by scalar" one/src/.git/config &&
215215
216216
test_subcommand git maintenance start <reconfigure &&
@@ -234,14 +234,14 @@ test_expect_success 'scalar reconfigure --all with includeIf.onbranch' '
234234
git init $num/src &&
235235
scalar register $num/src &&
236236
git -C $num/src config includeif."onbranch:foo".path something &&
237-
git -C $num/src config core.preloadIndex false || return 1
237+
git -C $num/src config unset gui.gcwarning || return 1
238238
done &&
239239
240240
scalar reconfigure --all &&
241241
242242
for num in $repos
243243
do
244-
test true = "$(git -C $num/src config core.preloadIndex)" || return 1
244+
test false = "$(git -C $num/src config gui.gcwarning)" || return 1
245245
done
246246
'
247247

@@ -256,7 +256,7 @@ test_expect_success 'scalar reconfigure --all with detached HEADs' '
256256
rm -rf $num/src &&
257257
git init $num/src &&
258258
scalar register $num/src &&
259-
git -C $num/src config core.preloadIndex false &&
259+
git -C $num/src config unset gui.gcwarning &&
260260
test_commit -C $num/src initial &&
261261
git -C $num/src switch --detach HEAD || return 1
262262
done &&
@@ -265,7 +265,7 @@ test_expect_success 'scalar reconfigure --all with detached HEADs' '
265265
266266
for num in $repos
267267
do
268-
test true = "$(git -C $num/src config core.preloadIndex)" || return 1
268+
test false = "$(git -C $num/src config gui.gcwarning)" || return 1
269269
done
270270
'
271271

@@ -297,7 +297,7 @@ test_expect_success 'scalar supports -c/-C' '
297297
git init sub &&
298298
scalar -C sub -c status.aheadBehind=bogus register &&
299299
test -z "$(git -C sub config --local status.aheadBehind)" &&
300-
test true = "$(git -C sub config core.preloadIndex)"
300+
test false = "$(git -C sub config gui.gcwarning)"
301301
'
302302

303303
test_expect_success '`scalar [...] <dir>` errors out when dir is missing' '

0 commit comments

Comments
 (0)