Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerrick Stolee <derrickstolee@github.com>2023-01-06 19:31:56 +0300
committerJunio C Hamano <gitster@pobox.com>2023-01-07 01:46:14 +0300
commit17194b195d5db1cfd19af57e817c29bd3fa75c02 (patch)
tree848d5f854a3150f031fdb5d3b98466da09aaac8c /read-cache.c
parentda9acde14ed4ea621b5db844630c1f620f24e110 (diff)
features: feature.manyFiles implies fast index writes
The recent addition of the index.skipHash config option allows index writes to speed up by skipping the hash computation for the trailing checksum. This is particularly critical for repositories with many files at HEAD, so add this config option to two cases where users in that scenario may opt-in to such behavior: 1. The feature.manyFiles config option enables some options that are helpful for repositories with many files at HEAD. 2. 'scalar register' and 'scalar reconfigure' set config options that optimize for large repositories. In both of these cases, set index.skipHash=true to gain this speedup. Add tests that demonstrate the proper way that index.skipHash=true can override feature.manyFiles=true. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index d73a81e41a..feefa0f68b 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2927,7 +2927,8 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
f = hashfd(tempfile->fd, tempfile->filename.buf);
- repo_config_get_bool(r, "index.skiphash", &f->skip_hash);
+ prepare_repo_settings(r);
+ f->skip_hash = r->settings.index_skip_hash;
for (i = removed = extended = 0; i < entries; i++) {
if (cache[i]->ce_flags & CE_REMOVE)