Subject: Re: [PATCH] midx: state what failed correctly

From: Taylor Blau <[email-masked]>
Date: Thu, 16 Apr 2026 17:17:38 -0400

On Thu, Apr 16, 2026 at 01:33:23PM -0700, Junio C Hamano wrote:
> ---
>  midx.c | 26 +++++++++++++++++---------
>  1 file changed, 17 insertions(+), 9 deletions(-)

The approach here seems very reasonable to me, and the implementation
matches it faithfully. I think that this makes sense to pick up, though
I suspect that there are other quality-of-life fixes that we could write
on top, e.g., to suppress duplicate "failed to load"-like messages,
which I recall having to deal with in the past.

The patch looks good to me, with one small nitpick:

> @@ -339,7 +347,7 @@ static struct multi_pack_index *load_midx_chain_fd_st(struct odb_source *source,
>  		strbuf_reset(&buf);
>  		get_split_midx_filename_ext(source, &buf,
>  					    layer.hash, MIDX_EXT_MIDX);
> -		m = load_multi_pack_index_one(source, buf.buf);
> +		m = load_multi_pack_index_one(source, buf.buf, 0);

Here you specify "missing_ok" as "0", but...

> @@ -387,7 +395,7 @@ struct multi_pack_index *load_multi_pack_index(struct odb_source *source)
>
>  	get_midx_filename(source, &midx_name);
>
> -	m = load_multi_pack_index_one(source, midx_name.buf);
> +	m = load_multi_pack_index_one(source, midx_name.buf, true);

Here you specify it as "true". Given the above I would have expected "1"
here, but I think that this hunk is preferable, and the earlier one
should use "false" instead.

Thanks,
Taylor