Subject: Re: [PATCH v2 5/5] repack: mark non-MIDX packs above the split as excluded-open

From: Derrick Stolee <[email-masked]>
Date: Thu, 26 Mar 2026 16:49:40 -0400

On 3/25/2026 7:51 PM, Taylor Blau wrote:

> diff --git a/builtin/repack.c b/builtin/repack.c
> index f6bb04bef72..4c5a82c2c8d 100644
> --- a/builtin/repack.c
> +++ b/builtin/repack.c
> @@ -369,8 +369,23 @@ int cmd_repack(int argc,
>  		 */
>  		for (i = 0; i < geometry.split; i++)
>  			fprintf(in, "%s\n", pack_basename(geometry.pack[i]));
> -		for (i = geometry.split; i < geometry.pack_nr; i++)
> -			fprintf(in, "^%s\n", pack_basename(geometry.pack[i]));
> +		for (i = geometry.split; i < geometry.pack_nr; i++) {
> +			const char *basename = pack_basename(geometry.pack[i]);
> +			char marker = '^';
> +
> +			if (!midx_must_contain_cruft &&
> +			    !string_list_has_string(&existing.midx_packs,
> +						    basename)) {
> +				/*
> +				 * Assume non-MIDX'd packs are not
> +				 * necessarily closed under
> +				 * reachability.
> +				 */
> +				marker = '!';
> +			}
> +
> +			fprintf(in, "%c%s\n", marker, basename);
> +		}
>  		fclose(in);

> -test_expect_failure 'repack rescues once-cruft objects above geometric split' '
> +test_expect_success 'repack rescues once-cruft objects above geometric split' '

I appreciate the brevity of this behavior change after you
established the new building blocks that make such a
concise change possible.

Thanks,
-Stolee