public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: "René Scharfe" <l.s.r@web•de>
To: git@vger•kernel.org
Subject: [PATCH 4/4] tag: stop using the_repository
Date: Sun, 28 Dec 2025 19:10:51 +0100	[thread overview]
Message-ID: <20251228181051.68724-5-l.s.r@web.de> (raw)
In-Reply-To: <20251228181051.68724-1-l.s.r@web.de>

gpg_verify_tag() shows the passed in object name on error.  Both callers
provide one.  It falls back to abbreviated hashes for future callers
that pass in a NULL name.  DEFAULT_ABBREV is default_abbrev, which in
turn is a global variable that's populated by git_default_config() and
only available with USE_THE_REPOSITORY_VARIABLE.

Don't let that hypothetical hold us back from getting rid of
the_repository in tag.c.  Fall back to full hashes, which are more
appropriate for error messages anyway.  This allows us to stop setting
USE_THE_REPOSITORY_VARIABLE.

Signed-off-by: René Scharfe <l.s.r@web•de>
---
 tag.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tag.c b/tag.c
index 9daeaf2a78..2f12e51024 100644
--- a/tag.c
+++ b/tag.c
@@ -1,4 +1,3 @@
-#define USE_THE_REPOSITORY_VARIABLE
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
@@ -58,7 +57,7 @@ int gpg_verify_tag(struct repository *r, const struct object_id *oid,
 		return error("%s: cannot verify a non-tag object of type %s.",
 				name_to_report ?
 				name_to_report :
-				repo_find_unique_abbrev(r, oid, DEFAULT_ABBREV),
+				oid_to_hex(oid),
 				type_name(type));
 
 	buf = odb_read_object(r->objects, oid, &type, &size);
@@ -66,7 +65,7 @@ int gpg_verify_tag(struct repository *r, const struct object_id *oid,
 		return error("%s: unable to read file.",
 				name_to_report ?
 				name_to_report :
-				repo_find_unique_abbrev(r, oid, DEFAULT_ABBREV));
+				oid_to_hex(oid));
 
 	ret = run_gpg_verify(buf, size, flags);
 
-- 
2.52.0


      parent reply	other threads:[~2025-12-28 18:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-28 18:10 [PATCH 0/4] tag: stop using the_repository René Scharfe
2025-12-28 18:10 ` [PATCH 1/4] tag: use algo of repo parameter in parse_tag_buffer() René Scharfe
2025-12-30 16:51   ` Kristoffer Haugsbakk
2025-12-28 18:10 ` [PATCH 2/4] tag: support arbitrary repositories in gpg_verify_tag() René Scharfe
2025-12-28 18:10 ` [PATCH 3/4] tag: support arbitrary repositories in parse_tag() René Scharfe
2025-12-28 18:10 ` René Scharfe [this message]

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20251228181051.68724-5-l.s.r@web.de \
    --to=l.s.r@web$(echo .)de \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox