Re: [PATCH 4/5] refs: introduce `refs_for_each_all_refs()`
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Jan 22, 2024, 15:48 UTC
- Message-ID
- <CAOLa=ZTbtqvejpvNVY5MHU=Adx3tWQ=FqVJdRLG1gaxYu4BG7A@mail.gmail.com>
- In-Reply-To
- <xmqqsf2thwhj.fsf@gitster.g>
On Fri, Jan 19, 2024 at 9:57 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
>
> This looks more like add_pseudoref_entries() given that the general
> direction is to have an "allow" list of pseudo refs (at this point
> after the previous step of the series, is_pseudoref_syntax() is the
> is_pseudoref() function, and uses ends_with("_HEAD") as a mere
> optimization to avoid listing all the possible pseudo refs that
> exists or will be added in the future whose name ends with "_HEAD").
>
> Other than the naming, I think these two steps make sense.I think overall the naming is correct, I would change the comments in `is_pseudoref_syntax()`.
Because, apart from pseudorefs, we also want to print HEAD. This is also why the pattern matches "HEAD" instead of "_HEAD". I'll add some more comments to clarify this.
So to summarize: 1. `is_pseudoref_syntax()` checks for pseudoref like syntax, this also matches HEAD. Will add comments here to clarify that we do not actually check ref contents. 2. `add_pseudoref_like_entries()` adds pseudorefs and HEAD to the loose refs cache.