Skip to content

Commit 9552c35

Browse files
ttaylorrgitster
authored andcommitted
t: retire 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP'
Two years ago, commit ff1e653 (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 ff1e653 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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3592796 commit 9552c35

10 files changed

+13
-44
lines changed

builtin/repack.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,10 +1217,6 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
12171217
if (!write_midx &&
12181218
(!(pack_everything & ALL_INTO_ONE) || !is_bare_repository()))
12191219
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;
12241220
}
12251221
if (pack_kept_objects < 0)
12261222
pack_kept_objects = write_bitmaps > 0 && !write_midx;
@@ -1518,12 +1514,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
15181514
if (run_update_server_info)
15191515
update_server_info(0);
15201516

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);
15271519

15281520
cleanup:
15291521
string_list_clear(&names, 1);

ci/run-build-and-tests.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ linux-TEST-vars)
2525
export GIT_TEST_COMMIT_GRAPH=1
2626
export GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=1
2727
export GIT_TEST_MULTI_PACK_INDEX=1
28-
export GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=1
2928
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
3029
export GIT_TEST_NO_WRITE_REV_INDEX=1
3130
export GIT_TEST_CHECKOUT_WORKERS=2

midx.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ struct bitmapped_pack;
2929
#define MIDX_LARGE_OFFSET_NEEDED 0x80000000
3030

3131
#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"
3432

3533
struct multi_pack_index {
3634
struct multi_pack_index *next;

t/README

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,10 +469,6 @@ GIT_TEST_MULTI_PACK_INDEX=<boolean>, when true, forces the multi-pack-
469469
index to be written after every 'git repack' command, and overrides the
470470
'core.multiPackIndex' setting to true.
471471

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-
476472
GIT_TEST_SIDEBAND_ALL=<boolean>, when true, overrides the
477473
'uploadpack.allowSidebandAll' setting to true, and when false, forces
478474
fetch-pack to not request sideband-all (even if the server advertises

t/t0410-partial-clone.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ test_description='partial clone'
55
. ./test-lib.sh
66
. "$TEST_DIRECTORY"/lib-terminal.sh
77

8-
# missing promisor objects cause repacks which write bitmaps to fail
9-
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
108
# When enabled, some commands will write commit-graphs. This causes fsck
119
# to fail when delete_object() is called because fsck will attempt to
1210
# verify the out-of-sync commit graph.

t/t5310-pack-bitmaps.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ test_description='exercise basic bitmap functionality'
55
. ./test-lib.sh
66
. "$TEST_DIRECTORY"/lib-bitmap.sh
77

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-
128
# Likewise, allow individual tests to control whether or not they use
139
# the boundary-based traversal.
1410
sane_unset GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL

t/t5319-multi-pack-index.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,7 @@ test_expect_success 'repack preserves multi-pack-index when creating packs' '
600600
compare_results_with_midx "after repack"
601601

602602
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 &&
605604
git multi-pack-index write &&
606605
git rev-list --test-bitmap HEAD
607606
'

t/t5326-multi-pack-bitmaps.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ test_description='exercise basic multi-pack bitmap functionality'
44
. ./test-lib.sh
55
. "${TEST_DIRECTORY}/lib-bitmap.sh"
66

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
88
# automatic ones.
99
GIT_TEST_MULTI_PACK_INDEX=0
10-
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
1110

1211
# This test exercise multi-pack bitmap functionality where the object order is
1312
# stored and read from a special chunk within the MIDX, so use the default

t/t5327-multi-pack-bitmaps-rev.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ test_description='exercise basic multi-pack bitmap functionality (.rev files)'
55
. ./test-lib.sh
66
. "${TEST_DIRECTORY}/lib-bitmap.sh"
77

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.
1010
GIT_TEST_MULTI_PACK_INDEX=0
11-
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
1211

1312
# Unlike t5326, this test exercise multi-pack bitmap functionality where the
1413
# object order is stored in a separate .rev file.

t/t7700-repack.sh

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,13 @@ test_expect_success 'objects in packs marked .keep are not repacked' '
7070

7171
test_expect_success 'writing bitmaps via command-line can duplicate .keep objects' '
7272
# 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 &&
7474
test_has_duplicate_object true
7575
'
7676

7777
test_expect_success 'writing bitmaps via config can duplicate .keep objects' '
7878
# 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 &&
8180
test_has_duplicate_object true
8281
'
8382

@@ -284,8 +283,7 @@ test_expect_success 'repacking fails when missing .pack actually means missing o
284283
test_expect_success 'bitmaps are created by default in bare repos' '
285284
git clone --bare .git bare.git &&
286285
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 &&
289287
bitmap=$(ls bare.git/objects/pack/*.bitmap) &&
290288
test_path_is_file "$bitmap"
291289
'
@@ -296,8 +294,7 @@ test_expect_success 'incremental repack does not complain' '
296294
'
297295

298296
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 &&
301298
bitmap=$(ls bare.git/objects/pack/*.bitmap || :) &&
302299
test -z "$bitmap"
303300
'
@@ -308,8 +305,7 @@ test_expect_success 'no bitmaps created if .keep files present' '
308305
keep=${pack%.pack}.keep &&
309306
test_when_finished "rm -f \"\$keep\"" &&
310307
>"$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 &&
313309
test_must_be_empty stderr &&
314310
find bare.git/objects/pack/ -type f -name "*.bitmap" >actual &&
315311
test_must_be_empty actual
@@ -320,8 +316,7 @@ test_expect_success 'auto-bitmaps do not complain if unavailable' '
320316
blob=$(test-tool genrandom big $((1024*1024)) |
321317
git -C bare.git hash-object -w --stdin) &&
322318
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 &&
325320
test_must_be_empty stderr &&
326321
find bare.git/objects/pack -type f -name "*.bitmap" >actual &&
327322
test_must_be_empty actual
@@ -342,9 +337,7 @@ test_expect_success 'repacking with a filter works' '
342337
'
343338

344339
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
348341
'
349342

350343
test_expect_success 'repacking with two filters works' '

0 commit comments

Comments
 (0)