t: retire 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP'

Two years ago, commit ff1e653c8e2 (midx: respect 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP', 2021-08-31) introduced a new environment variable which caused the test suite to write MIDX bitmaps after any 'git repack' invocation. At the time, this was done to help flush out any bugs with MIDX bitmaps that weren't explicitly covered in the t5326-multi-pack-bitmap.sh script. Two years later, that flag has served us well and is no longer providing meaningful coverage, as the script in t5326 has matured substantially and covers many more interesting cases than it did back when ff1e653c8e2 was originally written. Remove the 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP' environment variable as it is no longer serving a useful purpose. More importantly, removing this variable clears the way for us to introduce a new one to help similarly flush out bugs related to incremental MIDX chains. Because these incremental MIDX chains are (for now) incompatible with MIDX bitmaps, we cannot have both. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Taylor Blau committed Aug 6, 2024 at 11:38 UTC 9552c3595a77027a3d29b7a943bc2ecdba1c6813
10 files changed +13 -44
builtin/repack.c
+2 -10
@@ -1217,10 +1217,6 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
1217 if (!write_midx &&
1218 (!(pack_everything & ALL_INTO_ONE) || !is_bare_repository()))
1219 write_bitmaps = 0;
1220 - } else if (write_bitmaps &&
1221 - git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0) &&
1222 - git_env_bool(GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP, 0)) {
1223 - write_bitmaps = 0;
1220 }
1221 if (pack_kept_objects < 0)
1222 pack_kept_objects = write_bitmaps > 0 && !write_midx;
@@ -1518,12 +1514,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
1514 if (run_update_server_info)
1515 update_server_info(0);
1516
1521 - if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0)) {
1522 - unsigned flags = 0;
1523 - if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP, 0))
1524 - flags |= MIDX_WRITE_BITMAP | MIDX_WRITE_REV_INDEX;
1525 - write_midx_file(get_object_directory(), NULL, NULL, flags);
1526 - }
1517 + if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0))
1518 + write_midx_file(get_object_directory(), NULL, NULL, 0);
1519
1520 cleanup:
1521 string_list_clear(&names, 1);
ci/run-build-and-tests.sh
-1
@@ -25,7 +25,6 @@ linux-TEST-vars)
25 export GIT_TEST_COMMIT_GRAPH=1
26 export GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=1
27 export GIT_TEST_MULTI_PACK_INDEX=1
28 - export GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=1
28 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
29 export GIT_TEST_NO_WRITE_REV_INDEX=1
30 export GIT_TEST_CHECKOUT_WORKERS=2
midx.h
-2
@@ -29,8 +29,6 @@ struct bitmapped_pack;
29 #define MIDX_LARGE_OFFSET_NEEDED 0x80000000
30
31 #define GIT_TEST_MULTI_PACK_INDEX "GIT_TEST_MULTI_PACK_INDEX"
32 -#define GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP \
33 - "GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP"
32
33 struct multi_pack_index {
34 struct multi_pack_index *next;
t/README
-4
@@ -469,10 +469,6 @@ GIT_TEST_MULTI_PACK_INDEX=<boolean>, when true, forces the multi-pack-
469 index to be written after every 'git repack' command, and overrides the
470 'core.multiPackIndex' setting to true.
471
472 -GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=<boolean>, when true, sets the
473 -'--bitmap' option on all invocations of 'git multi-pack-index write',
474 -and ignores pack-objects' '--write-bitmap-index'.
475 -
472 GIT_TEST_SIDEBAND_ALL=<boolean>, when true, overrides the
473 'uploadpack.allowSidebandAll' setting to true, and when false, forces
474 fetch-pack to not request sideband-all (even if the server advertises
t/t0410-partial-clone.sh
-2
@@ -5,8 +5,6 @@ test_description='partial clone'
5 . ./test-lib.sh
6 . "$TEST_DIRECTORY"/lib-terminal.sh
7
8 -# missing promisor objects cause repacks which write bitmaps to fail
9 -GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
8 # When enabled, some commands will write commit-graphs. This causes fsck
9 # to fail when delete_object() is called because fsck will attempt to
10 # verify the out-of-sync commit graph.
t/t5310-pack-bitmaps.sh
-4
@@ -5,10 +5,6 @@ test_description='exercise basic bitmap functionality'
5 . ./test-lib.sh
6 . "$TEST_DIRECTORY"/lib-bitmap.sh
7
8 -# t5310 deals only with single-pack bitmaps, so don't write MIDX bitmaps in
9 -# their place.
10 -GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
11 -
8 # Likewise, allow individual tests to control whether or not they use
9 # the boundary-based traversal.
10 sane_unset GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL
t/t5319-multi-pack-index.sh
+1 -2
@@ -600,8 +600,7 @@ test_expect_success 'repack preserves multi-pack-index when creating packs' '
600 compare_results_with_midx "after repack"
601
602 test_expect_success 'multi-pack-index and pack-bitmap' '
603 - GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
604 - git -c repack.writeBitmaps=true repack -ad &&
603 + git -c repack.writeBitmaps=true repack -ad &&
604 git multi-pack-index write &&
605 git rev-list --test-bitmap HEAD
606 '
t/t5326-multi-pack-bitmaps.sh
+1 -2
@@ -4,10 +4,9 @@ test_description='exercise basic multi-pack bitmap functionality'
4 . ./test-lib.sh
5 . "${TEST_DIRECTORY}/lib-bitmap.sh"
6
7 -# We'll be writing our own midx and bitmaps, so avoid getting confused by the
7 +# We'll be writing our own MIDX, so avoid getting confused by the
8 # automatic ones.
9 GIT_TEST_MULTI_PACK_INDEX=0
10 -GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
10
11 # This test exercise multi-pack bitmap functionality where the object order is
12 # stored and read from a special chunk within the MIDX, so use the default
t/t5327-multi-pack-bitmaps-rev.sh
+2 -3
@@ -5,10 +5,9 @@ test_description='exercise basic multi-pack bitmap functionality (.rev files)'
5 . ./test-lib.sh
6 . "${TEST_DIRECTORY}/lib-bitmap.sh"
7
8 -# We'll be writing our own midx and bitmaps, so avoid getting confused by the
9 -# automatic ones.
8 +# We'll be writing our own MIDX, so avoid getting confused by the automatic
9 +# ones.
10 GIT_TEST_MULTI_PACK_INDEX=0
11 -GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
11
12 # Unlike t5326, this test exercise multi-pack bitmap functionality where the
13 # object order is stored in a separate .rev file.
t/t7700-repack.sh
+7 -14
@@ -70,14 +70,13 @@ test_expect_success 'objects in packs marked .keep are not repacked' '
70
71 test_expect_success 'writing bitmaps via command-line can duplicate .keep objects' '
72 # build on $oid, $packid, and .keep state from previous
73 - GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 git repack -Adbl &&
73 + git repack -Adbl &&
74 test_has_duplicate_object true
75 '
76
77 test_expect_success 'writing bitmaps via config can duplicate .keep objects' '
78 # build on $oid, $packid, and .keep state from previous
79 - GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
80 - git -c repack.writebitmaps=true repack -Adl &&
79 + git -c repack.writebitmaps=true repack -Adl &&
80 test_has_duplicate_object true
81 '
82
@@ -284,8 +283,7 @@ test_expect_success 'repacking fails when missing .pack actually means missing o
283 test_expect_success 'bitmaps are created by default in bare repos' '
284 git clone --bare .git bare.git &&
285 rm -f bare.git/objects/pack/*.bitmap &&
287 - GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
288 - git -C bare.git repack -ad &&
286 + git -C bare.git repack -ad &&
287 bitmap=$(ls bare.git/objects/pack/*.bitmap) &&
288 test_path_is_file "$bitmap"
289 '
@@ -296,8 +294,7 @@ test_expect_success 'incremental repack does not complain' '
294 '
295
296 test_expect_success 'bitmaps can be disabled on bare repos' '
299 - GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
300 - git -c repack.writeBitmaps=false -C bare.git repack -ad &&
297 + git -c repack.writeBitmaps=false -C bare.git repack -ad &&
298 bitmap=$(ls bare.git/objects/pack/*.bitmap || :) &&
299 test -z "$bitmap"
300 '
@@ -308,8 +305,7 @@ test_expect_success 'no bitmaps created if .keep files present' '
305 keep=${pack%.pack}.keep &&
306 test_when_finished "rm -f \"\$keep\"" &&
307 >"$keep" &&
311 - GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
312 - git -C bare.git repack -ad 2>stderr &&
308 + git -C bare.git repack -ad 2>stderr &&
309 test_must_be_empty stderr &&
310 find bare.git/objects/pack/ -type f -name "*.bitmap" >actual &&
311 test_must_be_empty actual
@@ -320,8 +316,7 @@ test_expect_success 'auto-bitmaps do not complain if unavailable' '
316 blob=$(test-tool genrandom big $((1024*1024)) |
317 git -C bare.git hash-object -w --stdin) &&
318 git -C bare.git update-ref refs/tags/big $blob &&
323 - GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
324 - git -C bare.git repack -ad 2>stderr &&
319 + git -C bare.git repack -ad 2>stderr &&
320 test_must_be_empty stderr &&
321 find bare.git/objects/pack -type f -name "*.bitmap" >actual &&
322 test_must_be_empty actual
@@ -342,9 +337,7 @@ test_expect_success 'repacking with a filter works' '
337 '
338
339 test_expect_success '--filter fails with --write-bitmap-index' '
345 - test_must_fail \
346 - env GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
347 - git -C bare.git repack -a -d --write-bitmap-index --filter=blob:none
340 + test_must_fail git -C bare.git repack -a -d --write-bitmap-index --filter=blob:none
341 '
342
343 test_expect_success 'repacking with two filters works' '