Re: [PATCH 19/24] refs.c: allow listing and deleting badly named refs
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 3, 2014, 20:39 UTC
- Message-ID
- <xmqqa95clwfo.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CAL=YDW=N1+XS+U=Vs0Sba0UqdN7+HRg5CTdZB28h5Ts3_yusYg@mail.gmail.com>
Ronnie Sahlberg <sahlberg@google.com> writes:
Show 13 quoted lines
> On Thu, Oct 2, 2014 at 11:55 AM, Junio C Hamano <gitster@pobox.com> wrote: > ... >> Thanks. We originally threw all the different kind of breakages >> into ISBROKEN, but a ref can have a malformed name or can contain a >> bad/non value and allowing us to tell them apart is a good direction >> to go. >> ... > > I updated cache.h to try to clarify it better. > The intention here is to expand the use of REF_ISBROKEN. > > For all cases REF_ISBROKEN will be set. This includes both "the sha1 > value is bad" as well as "a name is bad".
OK. As long as it is documented in a way to help other people who touch the code later to tell what these REF_* mean, either way is fine between "BADNAME is just one of the possible ways a ref is ISBROKEN" and "BADNAME is a way and ISBROKEN is another way for a ref to be bad", and I agree that the former (i.e. the way you defined) is easier on the existing code.
Thanks.