Skip to content

Commit

Permalink
repack: introduce repack.writeBitmaps config option
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Jun 10, 2014
1 parent 2bed2d4 commit 71d76cb
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
17 changes: 10 additions & 7 deletions Documentation/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1865,12 +1865,7 @@ pack.useBitmaps::
you are debugging pack bitmaps.

pack.writebitmaps::
When true, git will write a bitmap index when packing all
objects to disk (e.g., when `git repack -a` is run). This
index can speed up the "counting objects" phase of subsequent
packs created for clones and fetches, at the cost of some disk
space and extra time spent on the initial repack. Defaults to
false.
This is a deprecated synonym for `repack.writeBitmaps`.

pack.writeBitmapHashCache::
When true, git will include a "hash cache" section in the bitmap
Expand Down Expand Up @@ -2133,7 +2128,15 @@ repack.packKeptObjects::
`--pack-kept-objects` was passed. See linkgit:git-repack[1] for
details. Defaults to `false` normally, but `true` if a bitmap
index is being written (either via `--write-bitmap-index` or
`pack.writeBitmaps`).
`repack.writeBitmaps`).

repack.writeBitmaps::
When true, git will write a bitmap index when packing all
objects to disk (e.g., when `git repack -a` is run). This
index can speed up the "counting objects" phase of subsequent
packs created for clones and fetches, at the cost of some disk
space and extra time spent on the initial repack. Defaults to
false.

rerere.autoupdate::
When set to true, `git-rerere` updates the index with the
Expand Down
3 changes: 2 additions & 1 deletion builtin/repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ static int repack_config(const char *var, const char *value, void *cb)
pack_kept_objects = git_config_bool(var, value);
return 0;
}
if (!strcmp(var, "pack.writebitmaps")) {
if (!strcmp(var, "repack.writebitmaps") ||
!strcmp(var, "pack.writebitmaps")) {
write_bitmaps = git_config_bool(var, value);
return 0;
}
Expand Down
3 changes: 3 additions & 0 deletions t/perf/p5310-pack-bitmaps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ test_perf_large_repo
# note that we do everything through config,
# since we want to be able to compare bitmap-aware
# git versus non-bitmap git
#
# We intentionally use the deprecated pack.writebitmaps
# config so that we can test against older versions of git.
test_expect_success 'setup bitmap config' '
git config pack.writebitmaps true &&
git config pack.writebitmaphashcache true
Expand Down
2 changes: 1 addition & 1 deletion t/t5310-pack-bitmaps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test_expect_success 'setup repo with moderate-sized history' '
git checkout master &&
blob=$(echo tagged-blob | git hash-object -w --stdin) &&
git tag tagged-blob $blob &&
git config pack.writebitmaps true &&
git config repack.writebitmaps true &&
git config pack.writebitmaphashcache true
'

Expand Down
2 changes: 1 addition & 1 deletion t/t7700-repack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test_expect_success 'writing bitmaps via command-line can duplicate .keep object

test_expect_success 'writing bitmaps via config can duplicate .keep objects' '
# build on $objsha1, $packsha1, and .keep state from previous
git -c pack.writebitmaps=true repack -Adl &&
git -c repack.writebitmaps=true repack -Adl &&
test_when_finished "found_duplicate_object=" &&
for p in .git/objects/pack/*.idx; do
idx=$(basename $p)
Expand Down

0 comments on commit 71d76cb

Please sign in to comment.