Skip to content

Commit 71d76cb

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2bed2d4 commit 71d76cb

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

Documentation/config.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,12 +1865,7 @@ pack.useBitmaps::
18651865
you are debugging pack bitmaps.
18661866

18671867
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`.
18741869

18751870
pack.writeBitmapHashCache::
18761871
When true, git will include a "hash cache" section in the bitmap
@@ -2133,7 +2128,15 @@ repack.packKeptObjects::
21332128
`--pack-kept-objects` was passed. See linkgit:git-repack[1] for
21342129
details. Defaults to `false` normally, but `true` if a bitmap
21352130
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.
21372140

21382141
rerere.autoupdate::
21392142
When set to true, `git-rerere` updates the index with the

builtin/repack.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ static int repack_config(const char *var, const char *value, void *cb)
2828
pack_kept_objects = git_config_bool(var, value);
2929
return 0;
3030
}
31-
if (!strcmp(var, "pack.writebitmaps")) {
31+
if (!strcmp(var, "repack.writebitmaps") ||
32+
!strcmp(var, "pack.writebitmaps")) {
3233
write_bitmaps = git_config_bool(var, value);
3334
return 0;
3435
}

t/perf/p5310-pack-bitmaps.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ test_perf_large_repo
88
# note that we do everything through config,
99
# since we want to be able to compare bitmap-aware
1010
# 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.
1114
test_expect_success 'setup bitmap config' '
1215
git config pack.writebitmaps true &&
1316
git config pack.writebitmaphashcache true

t/t5310-pack-bitmaps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test_expect_success 'setup repo with moderate-sized history' '
1414
git checkout master &&
1515
blob=$(echo tagged-blob | git hash-object -w --stdin) &&
1616
git tag tagged-blob $blob &&
17-
git config pack.writebitmaps true &&
17+
git config repack.writebitmaps true &&
1818
git config pack.writebitmaphashcache true
1919
'
2020

t/t7700-repack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ test_expect_success 'writing bitmaps via command-line can duplicate .keep object
5353

5454
test_expect_success 'writing bitmaps via config can duplicate .keep objects' '
5555
# 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 &&
5757
test_when_finished "found_duplicate_object=" &&
5858
for p in .git/objects/pack/*.idx; do
5959
idx=$(basename $p)

0 commit comments

Comments
 (0)