Re: [PATCH v2 7/8] pack-objects: introduce '--stdin-packs=follow'
- From
Elijah Newren <newren@gmail.com>
- Date
- Apr 16, 2025, 05:26 UTC
- Message-ID
- <CABPp-BGbScKfZsADuwkHNU5L7FMnXTwv8aUSwV-Cor-VU3hsiw@mail.gmail.com>
- In-Reply-To
- <Z/7FdgYID9I1qR7K@nand.local>
On Tue, Apr 15, 2025 at 1:45 PM Taylor Blau <me@ttaylorr.com> wrote:
Show 21 quoted lines
> > > @@ -4467,6 +4484,23 @@ static int is_not_in_promisor_pack(struct commit *commit, void *data) {
> > > return is_not_in_promisor_pack_obj((struct object *) commit, data);
> > > }
> > >
> > > +static int parse_stdin_packs_mode(const struct option *opt, const char *arg,
> > > + int unset)
> > > +{
> > > + enum stdin_packs_mode *mode = opt->value;
> > > +
> > > + if (unset)
> > > + *mode = STDIN_PACKS_MODE_NONE;
> > > + else if (!arg || !*arg)
> > > + *mode = STDIN_PACKS_MODE_STANDARD;
> >
> > I don't understand why you have both a None mode and a Standard mode,
> > especially since the implementation seems to only care about whether
> > or not the Follow mode has been set. Shouldn't these both be setting
> > mode to the same value?
>
> I'm not sure I follow your question... stdin_packs is a tri-state. It
> can be off, on in standard/legacy mode, or on in follow mode.I was just confused. I looked in the code for STDIN_PACKS_MODE_{NONE,STANDARD,FOLLOW}, and other than initial setup, only the _FOLLOW variant was used anywhere. I overlooked the "if (stdin_packs" usage, which is what further distinguishes between _NONE and _STANDARD. Sorry.