Re: [PATCH 01/13] refs: introduce wrapper struct for `each_ref_fn`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Oct 9, 2025, 06:03 UTC
- Message-ID
- <aOdQTcH_ik3si29C@pks.im>
- In-Reply-To
- <aOaIuji6EDFi-Yg5@ArchLinux>
On Wed, Oct 08, 2025 at 11:52:26PM +0800, shejialuo wrote:
Show 22 quoted lines
> On Tue, Oct 07, 2025 at 12:58:38PM +0200, Patrick Steinhardt wrote:
> > diff --git a/refs.h b/refs.h
> > index 4e6bd63aa86..2b24a3d9974 100644
> > --- a/refs.h
> > +++ b/refs.h
> > @@ -355,14 +355,32 @@ struct ref_transaction;
> > */
> > #define REF_BAD_NAME 0x08
> >
> > +/* A reference passed to `for_each_ref()`-style callbacks. */
> > +struct reference {
> > + /* The fully-qualified name of the reference. */
> > + const char *name;
> > +
> > + /* The target of a symbolic ref. `NULL` for direct references. */
> > + const char *target;
> > +
>
> I have a question here, why do we name this `target` instead of
> `referent`? Oh, I somehow know your motivation as we already create a
> structure `struct reference`, it is redudant that we use `referent` as
> the name.I don't really have a strong reason to be honest, I think both "target" and "referent" would be fine.
Patrick