]> Nutra Git (v2) - gamesguru/git-remote-gcrypt.git/commitdiff
added gcrypt.publish-participants configuration
authorJoey Hess <joey@kitenet.net>
Tue, 15 Jul 2014 21:16:32 +0000 (17:16 -0400)
committerJoey Hess <joey@kitenet.net>
Tue, 15 Jul 2014 21:16:32 +0000 (17:16 -0400)
Fixes https://github.com/blake2-ppc/git-remote-gcrypt/issues/9

README.rst
git-remote-gcrypt

index fedd6b09cb9ca101313671b715e8f88a9b7ef805..ba0625985da96d704ee48cc6d15d76254b5b1d47 100644 (file)
@@ -60,6 +60,17 @@ The following ``git-config(1)`` variables are supported:
     The ``gcrypt-participants`` setting on the remote takes precedence
     over the repository variable ``gcrypt.participants``.
 
+``remote.<name>.gcrypt-publish-participants``
+    ..
+``gcrypt.publish-participants``
+    By default, the gpg key ids of the participants are obscured by
+    encrypting using `gpg -R`. Setting this option to `true` disables
+    that security measure.
+
+    The problem with using `gpg -R` is that to decrypt, gpg tries each
+    available secret key in turn until it finds a usable key.
+    This can result in unncessary passphrase prompts.
+
 ``remote.<name>.gcrypt-signingkey``
     ..
 ``user.signingkey``
@@ -68,6 +79,7 @@ The following ``git-config(1)`` variables are supported:
     part of the participant list. You may use the per-remote version
     to sign different remotes using different keys.
 
+
 Environment Variables
 =====================
 
index 22951114a02969a728db6a72cd0cbb2bca9cefaf..8d686695faf84989f186f956b7cd4964d04fc7d0 100755 (executable)
@@ -406,6 +406,8 @@ read_config()
                git config --path user.signingkey || :)
        conf_part=$(git config --get "remote.$NAME.gcrypt-participants" '.+' ||
                    git config --get gcrypt.participants '.+' || :)
+       Conf_pubish_participants=$(git config --get --bool "remote.$NAME.gcrypt-publish-participants" '.+' ||
+               git config --get --bool gcrypt.publish-participants || :)
 
        # Figure out which keys we should encrypt to or accept signatures from
        if isnull "$conf_part" || iseq "$conf_part" simple
@@ -440,7 +442,13 @@ read_config()
                }
                # Check 'E'ncrypt capability
                cap_=$(xfeed "$r_keyinfo" cut -f 12 -d :)
-               iseq "${cap_#*E}" "$cap_" || Recipients="$Recipients -R $keyid_"
+               if ! iseq "${cap_#*E}" "$cap_"; then
+                       if [ "$Conf_pubish_participants" = true ]; then
+                               Recipients="$Recipients -r $keyid_"
+                       else
+                               Recipients="$Recipients -R $keyid_"
+                       fi
+               fi
        done
 
        if isnull "$Recipients"