git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/4] ref-filter: fix %(symref) for pretty_print_ref()

From
ZheNing Hu via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 20, 2021, 07:37 UTC
Message-ID
<pull.1042.git.1632123476.gitgitgadget@gmail.com>

Because pretty_print_ref() currently has no ref_item flag, but the implementation of %(symref) need this flag, so git tag --verify or git verify-tag cannot get the output of %(symref). Therefore, %(symref) will be fixed in this patch series.

This bug was discovered by Peff here: https://lore.kernel.org/git/YUO63qy2%2F5wibY4%2F@coredump.intra.peff.net/

on the other hand, git tag --verify --format="%(refname)" or git verify-tag --forrmat="%(refname)" does not show the fullref name, but seems to be similar to using %(refname:lstrip=2).

And git verify-tag --format="verify: %(refname)" c06b72d02` will output: "verify: c06b72d02". They are wrong features, but because some scripts are using them, so our current approach is to keep them.

ZheNing Hu (4):
  refs: let repo_dwim_ref() learn get symref itself and ref flags
  ref-filter: provide ref_flags to pretty_print_ref()
  verify_tag: use repo_dwim_ref() to get ref fullname and ref_flags
  ref-filter: let tag verify use %(refname:lstrip=2) by default
 builtin/tag.c         | 16 ++++++++-------
 builtin/verify-tag.c  |  9 ++++++++-
 object-name.c         |  6 +++---
 ref-filter.c          | 47 +++++++++++++++++++++++++++++++++----------
 ref-filter.h          |  4 +++-
 refs.c                | 15 +++++++++-----
 refs.h                |  8 +++++---
 t/t7030-verify-tag.sh | 23 +++++++++++++++++++++
 upload-pack.c         |  2 +-
 9 files changed, 98 insertions(+), 32 deletions(-)
base-commit: 8b7c11b8668b4e774f81a9f0b4c30144b818f1d1
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1042%2Fadlternative%2Fpretty-print-ref-symref-fix-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1042/adlternative/pretty-print-ref-symref-fix-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1042
-- 
gitgitgadget
Next: ZheNing Hu via GitGitGadget
Message 1 of 5 in “ref-filter: fix %(symref) for pretty_print_ref()”
  1. 0/4 ref-filter: fix %(symref) for pretty_print_ref()ZheNing Hu via GitGitGadget, Sep 20, 2021
  2. 1/4 refs: let repo_dwim_ref() learn get symref itself and ref flagsZheNing Hu via GitGitGadget, Sep 20, 2021
  3. 2/4 ref-filter: provide ref_flags to pretty_print_ref()ZheNing Hu via GitGitGadget, Sep 20, 2021
  4. 3/4 verify_tag: use repo_dwim_ref() to get ref fullname and ref_flagsZheNing Hu via GitGitGadget, Sep 20, 2021
  5. 4/4 ref-filter: let tag verify use %(refname:lstrip=2) by defaultZheNing Hu via GitGitGadget, Sep 20, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.