Files
git/Documentation
Victoria Dye 188782ecb1 ref-filter.c: use peeled tag for '*' format fields
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.

Currently, if a user wants to filter & format refs and include information
about a recursively-dereferenced tag, they can do so with something like
'cat-file --batch-check':

    git for-each-ref --format="%(objectname)^{} %(refname)" <pattern> |
        git cat-file --batch-check="%(objectname) %(rest)"

But the combination of commands is inefficient. So, to improve the
performance of this use case and align the defererencing behavior of
'for-each-ref' with that of other commands, update the ref formatting code
to use the peeled tag (from 'peel_iterated_oid()') to populate '*' fields
rather than the tag's immediate target object (from 'get_tagged_oid()').

Additionally, add a test to 't6300-for-each-ref' to verify new nested tag
behavior and update 't6302-for-each-ref-filter.sh' to print the correct
value for nested dereferenced fields.

Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-11-16 14:03:01 +09:00
..
2023-11-02 16:59:16 +09:00
2023-06-12 13:52:51 -07:00
2023-02-18 09:29:13 -08:00
2023-06-12 13:52:51 -07:00
2023-06-12 13:52:51 -07:00
2023-06-12 13:52:51 -07:00
2022-10-25 15:44:18 -07:00
2023-06-12 13:52:51 -07:00
2022-02-02 14:50:09 -08:00
2023-05-06 14:32:20 -07:00
2021-09-28 10:31:02 -07:00
2023-06-12 13:52:51 -07:00
2023-06-12 13:52:51 -07:00
2021-12-10 14:35:03 -08:00
2023-05-16 11:38:14 -07:00
2023-06-27 11:31:06 -07:00
2023-07-31 09:11:04 -07:00
2023-06-12 13:52:51 -07:00
2023-08-28 09:16:06 -07:00
2023-06-12 13:52:51 -07:00