git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 17/19] t: retire 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP'

From
Taylor Blau <me@ttaylorr.com>
Date
Aug 6, 2024, 15:38 UTC
Message-ID
<3b268f91bf3ec74cee5fc3ceaab19d700e30233e.1722958596.git.me@ttaylorr.com>
In-Reply-To
<cover.1722958595.git.me@ttaylorr.com>

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>
---
 builtin/repack.c                  | 12 ++----------
 ci/run-build-and-tests.sh         |  1 -
 midx.h                            |  2 --
 t/README                          |  4 ----
 t/t0410-partial-clone.sh          |  2 --
 t/t5310-pack-bitmaps.sh           |  4 ----
 t/t5319-multi-pack-index.sh       |  3 +--
 t/t5326-multi-pack-bitmaps.sh     |  3 +--
 t/t5327-multi-pack-bitmaps-rev.sh |  5 ++---
 t/t7700-repack.sh                 | 21 +++++++--------------
 10 files changed, 13 insertions(+), 44 deletions(-)
diff --git a/builtin/repack.c b/builtin/repack.c
index f0317fa94a..8499bf0e12 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -1217,10 +1217,6 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
 		if (!write_midx &&
 		    (!(pack_everything & ALL_INTO_ONE) || !is_bare_repository()))
 			write_bitmaps = 0;
-	} else if (write_bitmaps &&
-		   git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0) &&
-		   git_env_bool(GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP, 0)) {
-		write_bitmaps = 0;
 	}
 	if (pack_kept_objects < 0)
 		pack_kept_objects = write_bitmaps > 0 && !write_midx;
@@ -1518,12 +1514,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
 	if (run_update_server_info)
 		update_server_info(0);
 
-	if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0)) {
-		unsigned flags = 0;
-		if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP, 0))
-			flags |= MIDX_WRITE_BITMAP | MIDX_WRITE_REV_INDEX;
-		write_midx_file(get_object_directory(), NULL, NULL, flags);
-	}
+	if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0))
+		write_midx_file(get_object_directory(), NULL, NULL, 0);
 
 cleanup:
 	string_list_clear(&names, 1);
diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh
index 98dda42045..e6fd68630c 100755
--- a/ci/run-build-and-tests.sh
+++ b/ci/run-build-and-tests.sh
@@ -25,7 +25,6 @@ linux-TEST-vars)
 	export GIT_TEST_COMMIT_GRAPH=1
 	export GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=1
 	export GIT_TEST_MULTI_PACK_INDEX=1
-	export GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=1
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_NO_WRITE_REV_INDEX=1
 	export GIT_TEST_CHECKOUT_WORKERS=2
diff --git a/midx.h b/midx.h
index 9d30935589..3714cad2cc 100644
--- a/midx.h
+++ b/midx.h
@@ -29,8 +29,6 @@ struct bitmapped_pack;
 #define MIDX_LARGE_OFFSET_NEEDED 0x80000000
 
 #define GIT_TEST_MULTI_PACK_INDEX "GIT_TEST_MULTI_PACK_INDEX"
-#define GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP \
-	"GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP"
 
 struct multi_pack_index {
 	struct multi_pack_index *next;
diff --git a/t/README b/t/README
index 724ee58195..3cee0c05e2 100644
--- a/t/README
+++ b/t/README
@@ -445,10 +445,6 @@ GIT_TEST_MULTI_PACK_INDEX=<boolean>, when true, forces the multi-pack-
 index to be written after every 'git repack' command, and overrides the
 'core.multiPackIndex' setting to true.
 
-GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=<boolean>, when true, sets the
-'--bitmap' option on all invocations of 'git multi-pack-index write',
-and ignores pack-objects' '--write-bitmap-index'.
-
 GIT_TEST_SIDEBAND_ALL=<boolean>, when true, overrides the
 'uploadpack.allowSidebandAll' setting to true, and when false, forces
 fetch-pack to not request sideband-all (even if the server advertises
diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh
index 2c30c86e7b..34bdb3ab1f 100755
--- a/t/t0410-partial-clone.sh
+++ b/t/t0410-partial-clone.sh
@@ -5,8 +5,6 @@ test_description='partial clone'
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-terminal.sh
 
-# missing promisor objects cause repacks which write bitmaps to fail
-GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
 # When enabled, some commands will write commit-graphs. This causes fsck
 # to fail when delete_object() is called because fsck will attempt to
 # verify the out-of-sync commit graph.
diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh
index d7fd71360e..a6de7c5764 100755
--- a/t/t5310-pack-bitmaps.sh
+++ b/t/t5310-pack-bitmaps.sh
@@ -5,10 +5,6 @@ test_description='exercise basic bitmap functionality'
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-bitmap.sh
 
-# t5310 deals only with single-pack bitmaps, so don't write MIDX bitmaps in
-# their place.
-GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
-
 # Likewise, allow individual tests to control whether or not they use
 # the boundary-based traversal.
 sane_unset GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL
diff --git a/t/t5319-multi-pack-index.sh b/t/t5319-multi-pack-index.sh
index ace5ac3b61..8c54fc0655 100755
--- a/t/t5319-multi-pack-index.sh
+++ b/t/t5319-multi-pack-index.sh
@@ -600,8 +600,7 @@ test_expect_success 'repack preserves multi-pack-index when creating packs' '
 compare_results_with_midx "after repack"
 
 test_expect_success 'multi-pack-index and pack-bitmap' '
-	GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
-		git -c repack.writeBitmaps=true repack -ad &&
+	git -c repack.writeBitmaps=true repack -ad &&
 	git multi-pack-index write &&
 	git rev-list --test-bitmap HEAD
 '
diff --git a/t/t5326-multi-pack-bitmaps.sh b/t/t5326-multi-pack-bitmaps.sh
index 916da389b6..1cb3e3ff08 100755
--- a/t/t5326-multi-pack-bitmaps.sh
+++ b/t/t5326-multi-pack-bitmaps.sh
@@ -4,10 +4,9 @@ test_description='exercise basic multi-pack bitmap functionality'
 . ./test-lib.sh
 . "${TEST_DIRECTORY}/lib-bitmap.sh"
 
-# We'll be writing our own midx and bitmaps, so avoid getting confused by the
+# We'll be writing our own MIDX, so avoid getting confused by the
 # automatic ones.
 GIT_TEST_MULTI_PACK_INDEX=0
-GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
 
 # This test exercise multi-pack bitmap functionality where the object order is
 # stored and read from a special chunk within the MIDX, so use the default
diff --git a/t/t5327-multi-pack-bitmaps-rev.sh b/t/t5327-multi-pack-bitmaps-rev.sh
index e65e311cd7..23db949c20 100755
--- a/t/t5327-multi-pack-bitmaps-rev.sh
+++ b/t/t5327-multi-pack-bitmaps-rev.sh
@@ -5,10 +5,9 @@ test_description='exercise basic multi-pack bitmap functionality (.rev files)'
 . ./test-lib.sh
 . "${TEST_DIRECTORY}/lib-bitmap.sh"
 
-# We'll be writing our own midx and bitmaps, so avoid getting confused by the
-# automatic ones.
+# We'll be writing our own MIDX, so avoid getting confused by the automatic
+# ones.
 GIT_TEST_MULTI_PACK_INDEX=0
-GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
 
 # Unlike t5326, this test exercise multi-pack bitmap functionality where the
 # object order is stored in a separate .rev file.
diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh
index 127efe99f8..8f34f05087 100755
--- a/t/t7700-repack.sh
+++ b/t/t7700-repack.sh
@@ -70,14 +70,13 @@ test_expect_success 'objects in packs marked .keep are not repacked' '
 
 test_expect_success 'writing bitmaps via command-line can duplicate .keep objects' '
 	# build on $oid, $packid, and .keep state from previous
-	GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 git repack -Adbl &&
+	git repack -Adbl &&
 	test_has_duplicate_object true
 '
 
 test_expect_success 'writing bitmaps via config can duplicate .keep objects' '
 	# build on $oid, $packid, and .keep state from previous
-	GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
-		git -c repack.writebitmaps=true repack -Adl &&
+	git -c repack.writebitmaps=true repack -Adl &&
 	test_has_duplicate_object true
 '
 
@@ -284,8 +283,7 @@ test_expect_success 'repacking fails when missing .pack actually means missing o
 test_expect_success 'bitmaps are created by default in bare repos' '
 	git clone --bare .git bare.git &&
 	rm -f bare.git/objects/pack/*.bitmap &&
-	GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
-		git -C bare.git repack -ad &&
+	git -C bare.git repack -ad &&
 	bitmap=$(ls bare.git/objects/pack/*.bitmap) &&
 	test_path_is_file "$bitmap"
 '
@@ -296,8 +294,7 @@ test_expect_success 'incremental repack does not complain' '
 '
 
 test_expect_success 'bitmaps can be disabled on bare repos' '
-	GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
-		git -c repack.writeBitmaps=false -C bare.git repack -ad &&
+	git -c repack.writeBitmaps=false -C bare.git repack -ad &&
 	bitmap=$(ls bare.git/objects/pack/*.bitmap || :) &&
 	test -z "$bitmap"
 '
@@ -308,8 +305,7 @@ test_expect_success 'no bitmaps created if .keep files present' '
 	keep=${pack%.pack}.keep &&
 	test_when_finished "rm -f \"\$keep\"" &&
 	>"$keep" &&
-	GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
-		git -C bare.git repack -ad 2>stderr &&
+	git -C bare.git repack -ad 2>stderr &&
 	test_must_be_empty stderr &&
 	find bare.git/objects/pack/ -type f -name "*.bitmap" >actual &&
 	test_must_be_empty actual
@@ -320,8 +316,7 @@ test_expect_success 'auto-bitmaps do not complain if unavailable' '
 	blob=$(test-tool genrandom big $((1024*1024)) |
 	       git -C bare.git hash-object -w --stdin) &&
 	git -C bare.git update-ref refs/tags/big $blob &&
-	GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
-		git -C bare.git repack -ad 2>stderr &&
+	git -C bare.git repack -ad 2>stderr &&
 	test_must_be_empty stderr &&
 	find bare.git/objects/pack -type f -name "*.bitmap" >actual &&
 	test_must_be_empty actual
@@ -342,9 +337,7 @@ test_expect_success 'repacking with a filter works' '
 '
 
 test_expect_success '--filter fails with --write-bitmap-index' '
-	test_must_fail \
-		env GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
-		git -C bare.git repack -a -d --write-bitmap-index --filter=blob:none
+	test_must_fail git -C bare.git repack -a -d --write-bitmap-index --filter=blob:none
 '
 
 test_expect_success 'repacking with two filters works' '
-- 
2.46.0.46.g406f326d27.dirty
Previous: Taylor BlauNext: Taylor Blau
Message 99 of 102 in “midx: incremental multi-pack indexes, part one”
  1. 00/19 midx: incremental multi-pack indexes, part oneTaylor Blau, Jun 6, 2024
  2. 01/19 Documentation: describe incremental MIDX formatTaylor Blau, Jun 6, 2024
  3. 02/19 midx: add new fields for incremental MIDX chainsTaylor Blau, Jun 6, 2024
  4. 03/19 midx: teach `nth_midxed_pack_int_id()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  5. 04/19 midx: teach `prepare_midx_pack()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  6. 05/19 midx: teach `nth_midxed_object_oid()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  7. 06/19 midx: teach `nth_bitmapped_pack()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  8. 07/19 midx: introduce `bsearch_one_midx()`Taylor Blau, Jun 6, 2024
  9. 08/19 midx: teach `bsearch_midx()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  10. 09/19 midx: teach `nth_midxed_offset()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  11. 10/19 midx: teach `fill_midx_entry()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  12. 11/19 midx: remove unused `midx_locate_pack()`Taylor Blau, Jun 6, 2024
  13. 12/19 midx: teach `midx_contains_pack()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  14. 13/19 midx: teach `midx_preferred_pack()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  15. 14/19 midx: teach `midx_fanout_add_midx_fanout()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  16. 15/19 midx: support reading incremental MIDX chainsTaylor Blau, Jun 6, 2024
  17. 16/19 midx: implement verification support for incremental MIDXsTaylor Blau, Jun 6, 2024
  18. 17/19 t: retire 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP'Taylor Blau, Jun 6, 2024
  19. 18/19 t/t5313-pack-bounds-checks.sh: prepare for sub-directoriesTaylor Blau, Jun 6, 2024
  20. 19/19 midx: implement support for writing incremental MIDX chainsTaylor Blau, Jun 6, 2024
  21. Taylor BlauJun 6, 2024
  22. Junio C HamanoJun 7, 2024
  23. Taylor BlauJun 7, 2024
  24. Junio C HamanoJun 7, 2024
  25. Taylor BlauJun 7, 2024
  26. Junio C HamanoJun 25, 2024
  27. Elijah NewrenJun 26, 2024
  28. 00/19 midx: incremental multi-pack indexes, part oneTaylor Blau, Jul 17, 2024
  29. 01/19 Documentation: describe incremental MIDX formatTaylor Blau, Jul 17, 2024
  30. Jeff KingAug 1, 2024
  31. Taylor BlauAug 1, 2024
  32. 02/19 midx: add new fields for incremental MIDX chainsTaylor Blau, Jul 17, 2024
  33. Jeff KingAug 1, 2024
  34. Taylor BlauAug 1, 2024
  35. 03/19 midx: teach `nth_midxed_pack_int_id()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  36. Jeff KingAug 1, 2024
  37. Taylor BlauAug 1, 2024
  38. 04/19 midx: teach `prepare_midx_pack()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  39. Jeff KingAug 1, 2024
  40. Taylor BlauAug 1, 2024
  41. 05/19 midx: teach `nth_midxed_object_oid()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  42. Jeff KingAug 1, 2024
  43. Taylor BlauAug 1, 2024
  44. 06/19 midx: teach `nth_bitmapped_pack()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  45. Jeff KingAug 1, 2024
  46. Taylor BlauAug 1, 2024
  47. 07/19 midx: introduce `bsearch_one_midx()`Taylor Blau, Jul 17, 2024
  48. Jeff KingAug 1, 2024
  49. Taylor BlauAug 1, 2024
  50. 08/19 midx: teach `bsearch_midx()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  51. Jeff KingAug 1, 2024
  52. 09/19 midx: teach `nth_midxed_offset()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  53. Jeff KingAug 1, 2024
  54. 10/19 midx: teach `fill_midx_entry()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  55. Jeff KingAug 1, 2024
  56. Taylor BlauAug 1, 2024
  57. 11/19 midx: remove unused `midx_locate_pack()`Taylor Blau, Jul 17, 2024
  58. Jeff KingAug 1, 2024
  59. Taylor BlauAug 1, 2024
  60. 12/19 midx: teach `midx_contains_pack()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  61. Jeff KingAug 1, 2024
  62. 13/19 midx: teach `midx_preferred_pack()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  63. Jeff KingAug 1, 2024
  64. Taylor BlauAug 1, 2024
  65. 14/19 midx: teach `midx_fanout_add_midx_fanout()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  66. Jeff KingAug 1, 2024
  67. Taylor BlauAug 1, 2024
  68. 15/19 midx: support reading incremental MIDX chainsTaylor Blau, Jul 17, 2024
  69. Jeff KingAug 1, 2024
  70. Taylor BlauAug 1, 2024
  71. 16/19 midx: implement verification support for incremental MIDXsTaylor Blau, Jul 17, 2024
  72. Jeff KingAug 1, 2024
  73. 17/19 t: retire 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP'Taylor Blau, Jul 17, 2024
  74. Jeff KingAug 1, 2024
  75. Taylor BlauAug 1, 2024
  76. 18/19 t/t5313-pack-bounds-checks.sh: prepare for sub-directoriesTaylor Blau, Jul 17, 2024
  77. 19/19 midx: implement support for writing incremental MIDX chainsTaylor Blau, Jul 17, 2024
  78. Jeff KingAug 1, 2024
  79. Taylor BlauAug 1, 2024
  80. Jeff KingAug 1, 2024
  81. Taylor BlauAug 1, 2024
  82. 00/19 midx: incremental multi-pack indexes, part oneTaylor Blau, Aug 6, 2024
  83. 01/19 Documentation: describe incremental MIDX formatTaylor Blau, Aug 6, 2024
  84. 02/19 midx: add new fields for incremental MIDX chainsTaylor Blau, Aug 6, 2024
  85. 03/19 midx: teach `nth_midxed_pack_int_id()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  86. 04/19 midx: teach `prepare_midx_pack()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  87. 05/19 midx: teach `nth_midxed_object_oid()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  88. 06/19 midx: teach `nth_bitmapped_pack()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  89. 07/19 midx: introduce `bsearch_one_midx()`Taylor Blau, Aug 6, 2024
  90. 08/19 midx: teach `bsearch_midx()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  91. 09/19 midx: teach `nth_midxed_offset()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  92. 10/19 midx: teach `fill_midx_entry()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  93. 11/19 midx: remove unused `midx_locate_pack()`Taylor Blau, Aug 6, 2024
  94. 12/19 midx: teach `midx_contains_pack()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  95. 13/19 midx: teach `midx_preferred_pack()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  96. 14/19 midx: teach `midx_fanout_add_midx_fanout()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  97. 15/19 midx: support reading incremental MIDX chainsTaylor Blau, Aug 6, 2024
  98. 16/19 midx: implement verification support for incremental MIDXsTaylor Blau, Aug 6, 2024
  99. 17/19 t: retire 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP'Taylor Blau, Aug 6, 2024
  100. 18/19 t/t5313-pack-bounds-checks.sh: prepare for sub-directoriesTaylor Blau, Aug 6, 2024
  101. 19/19 midx: implement support for writing incremental MIDX chainsTaylor Blau, Aug 6, 2024
  102. Jeff KingAug 12, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.