From: Karthik Nayak Date: Tue, 07 Oct 2025 14:27:55 GMT Subject: Re: [PATCH 03/13] refs: refactor reference status flags Message-ID: In-Reply-To: <20251007-b4-pks-ref-filter-skip-parsing-objects-v1-3-916cc7c6886b@pks.im> Patrick Steinhardt writes: > The reference flags encode information like whether or not a reference > is a symbolic reference or whether it may be broken. This information is > stored in a `int flags` bitfield, which is in conflict with our modern > best practices; we tend to use an unsigned integer to store flags. > > Change the type of the field to be `unsigned`. While at it, refactor the > individual flags to be part of an `enum` instead of using preprocessor > defines. > Using an enum is much nicer. > Signed-off-by: Patrick Steinhardt > --- > refs.h | 41 +++++++++++++++++++++-------------------- > 1 file changed, 21 insertions(+), 20 deletions(-) > > diff --git a/refs.h b/refs.h > index 2b24a3d997..8f484e2ffc 100644 > --- a/refs.h > +++ b/refs.h > @@ -333,27 +333,28 @@ struct ref_transaction; > * stored in ref_iterator::flags. Other bits are for internal use > * only: > */ > +enum reference_status { > + /* Reference is a symbolic reference. */ > + REF_ISSYMREF = (1 << 0), > Nit: It would also be nice to rename these flags to 'REFERENCE_STATUS_*', since that seems to be the pattern we generally follow. Doesn't have to be in your series though :) Rest looks good.