summaryrefslogtreecommitdiff
path: root/gpg-interface.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2015-06-21 23:14:42 +0000
committerJunio C Hamano <gitster@pobox.com>2015-06-22 14:20:47 -0700
commitaeff29dd4dab01b497b2a2cf73e982e846a5fe4c (patch)
tree368a26eec5e618e2496ffd991dd8c702caa72473 /gpg-interface.c
parentca194d50b84b53a0b711fef46d1a47657ec5da41 (diff)
downloadgit-aeff29dd4dab01b497b2a2cf73e982e846a5fe4c.tar.gz
verify-commit: add option to print raw gpg status information
verify-commit by default displays human-readable output on standard error. However, it can also be useful to get access to the raw gpg status information, which is machine-readable, allowing automated implementation of signing policy. Add a --raw option to make verify-commit produce the gpg status information on standard error instead of the human-readable format. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gpg-interface.c')
-rw-r--r--gpg-interface.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gpg-interface.c b/gpg-interface.c
index e764fb625b..3dc2fe397e 100644
--- a/gpg-interface.c
+++ b/gpg-interface.c
@@ -87,11 +87,14 @@ int check_signature(const char *payload, size_t plen, const char *signature,
void print_signature_buffer(const struct signature_check *sigc, unsigned flags)
{
+ const char *output = flags & GPG_VERIFY_RAW ?
+ sigc->gpg_status : sigc->gpg_output;
+
if (flags & GPG_VERIFY_VERBOSE && sigc->payload)
fputs(sigc->payload, stdout);
- if (sigc->gpg_output)
- fputs(sigc->gpg_output, stderr);
+ if (output)
+ fputs(output, stderr);
}
/*