repack: introduce repack.writeBitmaps config option

We currently have pack.writeBitmaps, which originally operated at the pack-objects level. This should really have been a repack.* option from day one. Let's give it the more sensible name, but keep the old version as a deprecated synonym. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jun 10, 2014 at 16:20 UTC 71d76cb48029c94af022ea9dc9c74b4ba8bcc3a3
5 files changed +17 -10
Documentation/config.txt
+10 -7
@@ -1865,12 +1865,7 @@ pack.useBitmaps::
1865 you are debugging pack bitmaps.
1866
1867 pack.writebitmaps::
1868 - When true, git will write a bitmap index when packing all
1869 - objects to disk (e.g., when `git repack -a` is run). This
1870 - index can speed up the "counting objects" phase of subsequent
1871 - packs created for clones and fetches, at the cost of some disk
1872 - space and extra time spent on the initial repack. Defaults to
1873 - false.
1868 + This is a deprecated synonym for `repack.writeBitmaps`.
1869
1870 pack.writeBitmapHashCache::
1871 When true, git will include a "hash cache" section in the bitmap
@@ -2133,7 +2128,15 @@ repack.packKeptObjects::
2128 `--pack-kept-objects` was passed. See linkgit:git-repack[1] for
2129 details. Defaults to `false` normally, but `true` if a bitmap
2130 index is being written (either via `--write-bitmap-index` or
2136 - `pack.writeBitmaps`).
2131 + `repack.writeBitmaps`).
2132 +
2133 +repack.writeBitmaps::
2134 + When true, git will write a bitmap index when packing all
2135 + objects to disk (e.g., when `git repack -a` is run). This
2136 + index can speed up the "counting objects" phase of subsequent
2137 + packs created for clones and fetches, at the cost of some disk
2138 + space and extra time spent on the initial repack. Defaults to
2139 + false.
2140
2141 rerere.autoupdate::
2142 When set to true, `git-rerere` updates the index with the
builtin/repack.c
+2 -1
@@ -28,7 +28,8 @@ static int repack_config(const char *var, const char *value, void *cb)
28 pack_kept_objects = git_config_bool(var, value);
29 return 0;
30 }
31 - if (!strcmp(var, "pack.writebitmaps")) {
31 + if (!strcmp(var, "repack.writebitmaps") ||
32 + !strcmp(var, "pack.writebitmaps")) {
33 write_bitmaps = git_config_bool(var, value);
34 return 0;
35 }
t/perf/p5310-pack-bitmaps.sh
+3
@@ -8,6 +8,9 @@ test_perf_large_repo
8 # note that we do everything through config,
9 # since we want to be able to compare bitmap-aware
10 # git versus non-bitmap git
11 +#
12 +# We intentionally use the deprecated pack.writebitmaps
13 +# config so that we can test against older versions of git.
14 test_expect_success 'setup bitmap config' '
15 git config pack.writebitmaps true &&
16 git config pack.writebitmaphashcache true
t/t5310-pack-bitmaps.sh
+1 -1
@@ -14,7 +14,7 @@ test_expect_success 'setup repo with moderate-sized history' '
14 git checkout master &&
15 blob=$(echo tagged-blob | git hash-object -w --stdin) &&
16 git tag tagged-blob $blob &&
17 - git config pack.writebitmaps true &&
17 + git config repack.writebitmaps true &&
18 git config pack.writebitmaphashcache true
19 '
20
t/t7700-repack.sh
+1 -1
@@ -53,7 +53,7 @@ test_expect_success 'writing bitmaps via command-line can duplicate .keep object
53
54 test_expect_success 'writing bitmaps via config can duplicate .keep objects' '
55 # build on $objsha1, $packsha1, and .keep state from previous
56 - git -c pack.writebitmaps=true repack -Adl &&
56 + git -c repack.writebitmaps=true repack -Adl &&
57 test_when_finished "found_duplicate_object=" &&
58 for p in .git/objects/pack/*.idx; do
59 idx=$(basename $p)