Re: [PATCH v3 4/4] for-each-ref: avoid filtering on empty pattern
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Feb 9, 2024, 18:27 UTC
- Message-ID
- <CAOLa=ZS3y=K6SCEoC7hZSi7vhAT1-W4fAzPb3rYaBbGcqO5Cyw@mail.gmail.com>
- In-Reply-To
- <xmqq8r3timnr.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 27 quoted lines
> Patrick Steinhardt <ps@pks.im> writes: > >> Depending on the answer, I think we can go one of two ways: >> >> - Accept the diverging behaviour and add `--include-all-refs`. The >> "files" backend does a best effort and only includes root refs, the >> "reftable" backend lists all refs. >> >> - Double down on the fact that refs must either be pseudo refs or >> start with "refs/" and treat any ref that doesn't fit this bill as >> corrupted. The consequence here would be that we instead go with >> `--include-root-refs` that can be implemented the same for both >> backends. In addition, we add checks to git-fsck(1) to surface and >> flag refs with bogus names for the "reftable" backend. >> >> While I seem to have convinced you that `--include-all-refs` might not >> be a bad idea after all, you have convinced me by now that the second >> option would be preferable. I'd be okay with either of these options as >> both of them address the issue at hand. > > For now my tentative preference is the latter. If ref/head/foo is > an end-user mistake with one backend, it is cleaner if it is > considered a mistake with other backends. > > Doesn't our ref enumeration/iteration API have "include broken ones > as well" bit? I wonder if this issue becomes easier to solve by > (re|ab)using that bit.
I'll then go ahead with point 2 then.
I'll modify my patch series for now to fit in and will follow up "checks to git-fsck(1) to surface and flag refs with bogus names for the "reftable" backend" in a follow up series.
- Karthik