Re: [PATCH v2 09/10] ref-filter.c: use peeled tag for '*' format fields
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 16, 2023, 05:48 UTC
- Message-ID
- <xmqq4jhms0xq.fsf@gitster.g>
- In-Reply-To
- <48254d8e161de7f0e165510c06801195f9b0a8fd.1699991638.git.gitgitgadget@gmail.com>
"Victoria Dye via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 12 quoted lines
> From: Victoria Dye <vdye@github.com>
>
> In most builtins ('rev-parse <revision>^{}', 'show-ref --dereference'),
> "dereferencing" a tag refers to a recursive peel of the tag object. Unlike
> these cases, the dereferencing prefix ('*') in 'for-each-ref' format
> specifiers triggers only a single, non-recursive dereference of a given tag
> object. For most annotated tags, a single dereference is all that is needed
> to access the tag's associated commit or tree; "recursive" and
> "non-recursive" dereferencing are functionally equivalent in these cases.
> However, nested tags (annotated tags whose target is another annotated tag)
> dereferenced once return another tag, where a recursive dereference would
> return the commit or tree.This may be the only potentially controversial step in the series.
Show 8 quoted lines
> - /* > - * NEEDSWORK: This derefs tag only once, which > - * is good to deal with chains of trust, but > - * is not consistent with what deref_tag() does > - * which peels the onion to the core. > - */ > return get_object(ref, 1, &obj, &oi_deref, err); > }
Very nice to see an ancient comment I added at 9f613ddd (Add git-for-each-ref: helper for language bindings, 2006-09-15) finally go.
Thanks.