Skip to contentSkip to conversation

verify-tag: Parse GPG configuration options.

PATCH In review Alex Zepeda 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 verify-tag: Parse GPG configuration options.

Modify verify-tag to load relevant GPG variables from the git configuratio file. This allows git tag -v to use an alternative GPG binary in the same way that git tag -s does.

---
 builtin/verify-tag.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
builtin/verify-tag.c +9 -1
index 28c2174..986789f 100644
@@ -58,6 +58,14 @@ static int verify_tag(const char *name, int verbose)
 	return ret;
 }
 
+static int git_verify_tag_config(const char *var, const char *value, void *cb)
+{
+	int status = git_gpg_config(var, value, cb);
+	if (status)
+		return status;
+	return git_default_config(var, value, cb);
+}
+
 int cmd_verify_tag(int argc, const char **argv, const char *prefix)
 {
 	int i = 1, verbose = 0, had_error = 0;
@@ -66,7 +74,7 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix)
 		OPT_END()
 	};
 
-	git_config(git_default_config, NULL);
+	git_config(git_verify_tag_config, NULL);
 
 	argc = parse_options(argc, argv, prefix, verify_tag_options,
 			     verify_tag_usage, PARSE_OPT_KEEP_ARGV0);
Signature · 1 line
1.7.9.1
#1 lore raw
Quoted 6 lines · Alex Zepeda

Modify verify-tag to load relevant GPG variables from the git configuratio file. This allows git tag -v to use an alternative GPG binary in the same way that git tag -s does.

---

Makes sense; thanks.

Quoted 31 lines
 builtin/verify-tag.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
builtin/verify-tag.c +9 -1
index 28c2174..986789f 100644
@@ -58,6 +58,14 @@ static int verify_tag(const char *name, int verbose)
 	return ret;
 }
 
+static int git_verify_tag_config(const char *var, const char *value, void *cb)
+{
+	int status = git_gpg_config(var, value, cb);
+	if (status)
+		return status;
+	return git_default_config(var, value, cb);
+}
+
 int cmd_verify_tag(int argc, const char **argv, const char *prefix)
 {
 	int i = 1, verbose = 0, had_error = 0;
@@ -66,7 +74,7 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix)
 		OPT_END()
 	};
 
-	git_config(git_default_config, NULL);
+	git_config(git_verify_tag_config, NULL);
 
 	argc = parse_options(argc, argv, prefix, verify_tag_options,
 			     verify_tag_usage, PARSE_OPT_KEEP_ARGV0);