summaryrefslogtreecommitdiff
path: root/gpg-interface.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2015-06-21 23:14:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-06-22 21:20:47 (GMT)
commitaeff29dd4dab01b497b2a2cf73e982e846a5fe4c (patch)
tree368a26eec5e618e2496ffd991dd8c702caa72473 /gpg-interface.c
parentca194d50b84b53a0b711fef46d1a47657ec5da41 (diff)
downloadgit-aeff29dd4dab01b497b2a2cf73e982e846a5fe4c.zip
git-aeff29dd4dab01b497b2a2cf73e982e846a5fe4c.tar.gz
git-aeff29dd4dab01b497b2a2cf73e982e846a5fe4c.tar.bz2
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 e764fb6..3dc2fe3 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);
}
/*