All of
 help / color / mirror / Atom feed
From: "ZheNing Hu via GitGitGadget" <>
Cc: Junio C Hamano <>, Jeff King <>,
	ZheNing Hu <>,
	ZheNing Hu <>
Subject: [PATCH 3/4] verify_tag: use repo_dwim_ref() to get ref fullname and ref_flags
Date: Mon, 20 Sep 2021 07:37:55 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

From: ZheNing Hu <>

Since verify-tag cannot currently use %(symref) correctly, we need
to get the ref flags from pretty_print_ref() caller. So use
repo_dwim_ref() in cmd_verify_tag() to get fullref name and ref flags
and pass to pretty_print_ref(), which can help us fix %(symref)

Signed-off-by: ZheNing Hu <>
 builtin/verify-tag.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c
index 403f2080efa..efc8282782a 100644
--- a/builtin/verify-tag.c
+++ b/builtin/verify-tag.c
@@ -59,6 +59,8 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix)
 	while (i < argc) {
 		struct object_id oid;
 		const char *name = argv[i++];
+		char *refname;
+		int ref_flags;
 		if (get_oid(name, &oid)) {
 			had_error = !!error("tag '%s' not found.", name);
@@ -70,8 +72,10 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix)
+		if (repo_dwim_ref(the_repository, name, strlen(name), &oid, &refname, 0, &ref_flags, 1))
+			name = refname;
 		if (format.format)
-			pretty_print_ref(name, &oid, &format, 0);
+			pretty_print_ref(name, &oid, &format, ref_flags);
 	return had_error;

  parent reply	other threads:[~2021-09-20  7:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20  7:37 [PATCH 0/4] ref-filter: fix %(symref) for pretty_print_ref() ZheNing Hu via GitGitGadget
2021-09-20  7:37 ` [PATCH 1/4] refs: let repo_dwim_ref() learn get symref itself and ref flags ZheNing Hu via GitGitGadget
2021-09-20  7:37 ` [PATCH 2/4] ref-filter: provide ref_flags to pretty_print_ref() ZheNing Hu via GitGitGadget
2021-09-20  7:37 ` ZheNing Hu via GitGitGadget [this message]
2021-09-20  7:37 ` [PATCH 4/4] ref-filter: let tag verify use %(refname:lstrip=2) by default ZheNing Hu via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.