Re: [PATCH v2 09/10] ref-filter.c: use peeled tag for '*' format fields
From: Junio C Hamano <hidden>
Date: 2023-11-16 05:48:54
"Victoria Dye via GitGitGadget" [off-list ref] writes:
From: Victoria Dye <redacted>
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.
- /* - * 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.