summaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2016-04-28 07:28:55 +0000
committerJunio C Hamano <gitster@pobox.com>2016-04-28 09:58:14 -0700
commit9cea46cdda9359e54aec379c4b4e2f9470c35023 (patch)
tree702a6b33dbe14a711690490bd3ea550347ddd1ec /builtin/pack-objects.c
parent625efa9decb64e2b51c4bef342922553729cf2f6 (diff)
downloadgit-9cea46cdda9359e54aec379c4b4e2f9470c35023.tar.gz
pack-objects: warn on split packs disabling bitmapsew/doc-split-pack-disables-bitmap
It can be tempting for a server admin to want a stable set of long-lived packs for dumb clients; but also want to enable bitmaps to serve smart clients more quickly. Unfortunately, such a configuration is impossible; so at least warn users of this incompatibility since commit 21134714 (pack-objects: turn off bitmaps when we split packs, 2014-10-16). Tested the warning by inspecting the output of: make -C t t5310-pack-bitmaps.sh GIT_TEST_OPTS=-v Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index a27de5b323..b6664ce4d8 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -759,6 +759,10 @@ static off_t write_reused_pack(struct sha1file *f)
return reuse_packfile_offset - sizeof(struct pack_header);
}
+static const char no_split_warning[] = N_(
+"disabling bitmap writing, packs are split due to pack.packSizeLimit"
+);
+
static void write_pack_file(void)
{
uint32_t i = 0, j;
@@ -813,7 +817,10 @@ static void write_pack_file(void)
fixup_pack_header_footer(fd, sha1, pack_tmp_name,
nr_written, sha1, offset);
close(fd);
- write_bitmap_index = 0;
+ if (write_bitmap_index) {
+ warning(_(no_split_warning));
+ write_bitmap_index = 0;
+ }
}
if (!pack_to_stdout) {