Subject: Re: [PATCH 0/8] odb: track multi-pack-indices via their object sources

From: Junio C Hamano <[email-masked]>
Date: Wed, 09 Jul 2025 15:04:44 -0700

Patrick Steinhardt <[email-masked]> writes:

> This patch series thus refactors the codebase to stop tracking MIDX's
> globally. Instead, they are being pushed down one level so that every
> `struct odb_source` has an optional MIDX itself. This simplifies some of
> our code and will make it easier in a future iteration to move the data
> into a packfile-specific object source backend.
>
> This series is built on top of a30f80fde92 (The eighth batch,
> 2025-07-08) with "ps/object-store" at 841a03b4046 (odb: rename
> `read_object_with_reference()`, 2025-07-01) merged into it.

You do not have to deal with it just yet, but FYI, another topic in
flight has a commit that adds a few more callers to a function this
topic renames away.  Namely, 5ee86c27 (repack: exclude cruft pack(s)
from the MIDX where possible, 2025-06-23).

If this topic needs to be rerolled after the other topic graduates
to 'master', we may need to see this topic rebased on a newer
'master' with something like the attached patch squashed in, but
because the other topic is at least a few more days away from
'next', and it might still need another final finishing touch
iteration, let's keep these two topics independent from each other a
bit longer, and let me deal with this trivial semantic conflict
resolution, at least for now.

Thanks.

diff --git a/builtin/repack.c b/builtin/repack.c
index a74b2ca7f3..21723866b9 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -1531,7 +1531,7 @@ int cmd_repack(int argc,
 		 * midx_has_unknown_packs() will make the decision for
 		 * us.
 		 */
-		if (!get_local_multi_pack_index(the_repository))
+		if (!get_multi_pack_index(the_repository->objects->sources))
 			midx_must_contain_cruft = 1;
 	}
 
@@ -1614,9 +1614,9 @@ int cmd_repack(int argc,
 
 	string_list_sort(&names);
 
-	if (get_local_multi_pack_index(the_repository)) {
+	if (get_multi_pack_index(the_repository->objects->sources)) {
 		struct multi_pack_index *m =
-			get_local_multi_pack_index(the_repository);
+			get_multi_pack_index(the_repository->objects->sources);
 
 		ALLOC_ARRAY(midx_pack_names,
 			    m->num_packs + m->num_packs_in_base);
-- 
2.50.1-382-gda22511645