Re: [PATCH v3 4/6] config: add git_configset_alloc() and git_configset_clear_and_free()
- From
Josh Steadmon <steadmon@google.com>
- Date
- Oct 2, 2024, 22:45 UTC
- Message-ID
- <g5h3agfmrsves4lazgohzihkqmao47obr2deh2t3nxlauwxj4s@p5fqzqwfcvpo>
- In-Reply-To
- <CAPig+cRKbvWT3Bx65-ULAYRSrrKTCL0C7r6xpNSdN5JjLBPjCQ@mail.gmail.com>
On 2024.09.06 19:24, Eric Sunshine wrote:
Show 24 quoted lines
> On Fri, Sep 6, 2024 at 6:21 PM Calvin Wan <calvinwan@google.com> wrote:
> > From: Josh Steadmon <steadmon@google.com>
> >
> > Add git_configset_alloc() and git_configset_clear_and_free() functions
> > so that callers can manage config_set structs on the heap. This also
> > allows non-C external consumers to treat config_sets as opaque structs.
> >
> > Co-authored-by: Calvin Wan <calvinwan@google.com>
> > Signed-off-by: Calvin Wan <calvinwan@google.com>
>
> Almost all these patches suffer from some sort of missing Josh
> trailer, so I'll stop mentioning it now.
>
> > diff --git a/config.h b/config.h
> > @@ -472,6 +472,11 @@ struct config_set {
> > +/**
> > + * Alloc a config_set
> > + */
> > +struct config_set *git_configset_alloc(void);
>
> Should this documentation string mention that git_configset_alloc()
> does _not_ initialize the configset? Alternatively, should this
> function also initialize it as a convenience (and mention so in the
> documentation)?Yes, in V4 this will both alloc and init the configset (and the function has been moved to the shim library).