Subject: Re: [PATCH v2 4/5] pack-objects: support excluded-open packs with --stdin-packs

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

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

>  struct stdin_pack_info {
>  	struct packed_git *p;
>  	enum {
>  		STDIN_PACK_INCLUDE = (1<<0),
>  		STDIN_PACK_EXCLUDE_CLOSED = (1<<1),
> +		STDIN_PACK_EXCLUDE_OPEN = (1<<2),
>  	} kind;

Especially because we're extending this, I feel more confident
that this would improve by being a named enum. Perhaps these
modes could get comments explaining their differences and how
they might operate in combination.

>  		if (!*key)
>  			continue;
> -		if (*key == '^')
> +		if (*key == '^' ||
> +		    (*key == '!' && mode == STDIN_PACKS_MODE_FOLLOW))
>  			key++;

This part is getting more complicated, giving potentially more
reason to start with a single branching point in patch 2.

> diff --git a/t/t5331-pack-objects-stdin.sh b/t/t5331-pack-objects-stdin.sh
> index 7eb79bc2cdb..c74b5861af3 100755
> --- a/t/t5331-pack-objects-stdin.sh
> +++ b/t/t5331-pack-objects-stdin.sh
> @@ -415,4 +415,109 @@ test_expect_success '--stdin-packs=follow tolerates missing commits' '
>  	stdin_packs__follow_with_only HEAD HEAD^{tree}
>  '

I see that this isn't yet the fix that turns failure into success.
I look forward to seeing that changeover.

Thanks,
-Stolee