path: root/t
diff options
authorMichael J Gruber <>2016-10-12 13:04:15 (GMT)
committerJunio C Hamano <>2016-10-12 17:41:59 (GMT)
commit661a1806819ca98c446f82b19e6c98fa174d33a4 (patch)
treefce87ad1b1ffffc6933ab25a667bb96167de4c8f /t
parent21f862b498925194f8f1ebe8203b7a7df756555b (diff)
gpg-interface: use more status letters
According to gpg2's doc/DETAILS: For each signature only one of the codes GOODSIG, BADSIG, EXPSIG, EXPKEYSIG, REVKEYSIG or ERRSIG will be emitted. gpg1 ("classic") behaves the same (although doc/DETAILS differs). Currently, we parse gpg's status output for GOODSIG, BADSIG and trust information and translate that into status codes G, B, U, N for the %G? format specifier. git-verify-* returns success in the GOODSIG case only. This is somewhat in disagreement with gpg, which considers the first 5 of the 6 above as VALIDSIG, but we err on the very safe side. Introduce additional status codes E, X, Y, R for ERRSIG, EXPSIG, EXPKEYSIG, and REVKEYSIG so that a user of %G? gets more information about the absence of a 'G' on first glance. Requested-by: Alex <> Signed-off-by: Michael J Gruber <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't')
1 files changed, 12 insertions, 1 deletions
diff --git a/t/ b/t/
index 6e839f5..762135a 100755
--- a/t/
+++ b/t/
@@ -2,6 +2,7 @@
test_description='signed commit tests'
. ./
test_expect_success GPG 'create signed commits' '
@@ -190,7 +191,7 @@ test_expect_success GPG 'show bad signature with custom format' '
test_cmp expect actual
-test_expect_success GPG 'show unknown signature with custom format' '
+test_expect_success GPG 'show untrusted signature with custom format' '
cat >expect <<-\EOF &&
@@ -200,6 +201,16 @@ test_expect_success GPG 'show unknown signature with custom format' '
test_cmp expect actual
+test_expect_success GPG 'show unknown signature with custom format' '
+ cat >expect <<-\EOF &&
+ E
+ 61092E85B7227189
+ GNUPGHOME="$GNUPGHOME_NOT_USED" git log -1 --format="%G?%n%GK%n%GS" eighth-signed-alt >actual &&
+ test_cmp expect actual
test_expect_success GPG 'show lack of signature with custom format' '
cat >expect <<-\EOF &&