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

[PATCH] builtin/send-pack: report gpg config errors

From
Stefan Beller <sbeller@google.com>
Date
Jun 12, 2018, 17:53 UTC
Message-ID
<20180612175344.65466-1-sbeller@google.com>
In-Reply-To
<xmqqk1r3aorh.fsf@gitster-ct.c.googlers.com>

Any caller except of git_gpg_config() except the one in send_pack_config() handles the return value of git_gpg_config(). Also handle the return value there.

Signed-off-by: Stefan Beller <sbeller@google.com>
---
> Makes sense.  I wonder if this was deliberate

There was no need for other configuration to be loaded and signing pushes is the first that needs repository configuration.

Looking at 68c757f2199 (push: add a config option push.gpgSign for default signed pushes, 2015-08-19) further, maybe we want to also have this?

Thanks, Stefan

 builtin/send-pack.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index 4923b1058c6..b54a0cae878 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -101,7 +101,8 @@ static void print_helper_status(struct ref *ref)
 
 static int send_pack_config(const char *k, const char *v, void *cb)
 {
-	git_gpg_config(k, v, NULL);
+	if (git_gpg_config(k, v, NULL) < 0)
+		return -1;
 
 	if (!strcmp(k, "push.gpgsign")) {
 		const char *value;
-- 
2.18.0.rc1.244.gcf134e6275-goog
Previous: Junio C HamanoNext: Eric Sunshine
Message 3 of 8 in “builtin/send-pack: populate the default configs”
  1. builtin/send-pack: populate the default configsMasaya Suzuki, Jun 12, 2018
  2. Junio C HamanoJun 12, 2018
  3. builtin/send-pack: report gpg config errorsStefan Beller, Jun 12, 2018
  4. Eric SunshineJun 12, 2018
  5. Jonathan NiederJun 12, 2018
  6. Stefan BellerJun 12, 2018
  7. Jonathan NiederJun 12, 2018
  8. Eric SunshineJun 12, 2018

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.