]> Nutra Git (v2) - gamesguru/git-remote-gcrypt.git/commitdiff
Encrypt to self by default; basic functionality now needs no configuration
authorroot <root@localhost>
Thu, 14 Feb 2013 00:00:00 +0000 (00:00 +0000)
committerroot <root@localhost>
Thu, 14 Feb 2013 00:00:00 +0000 (00:00 +0000)
Introduces gcrypt.participants "simple" mode which encrypts to self, and
accepts any valid signature by default. No configuration needed for
private repositories.

We also adds  remote.<name>.gcrypt-participants to configure this per
remote.

git-remote-gcrypt

index 98c8ee6d047eb960b2dddd82387c16021496fd41..93665dd70693efd0e8b7fd9b4648ff69181e5251 100755 (executable)
@@ -328,7 +328,8 @@ read_config()
        local recp_= key_line= cap_= conf_keyring= conf_part=
        Conf_signkey=$(git config --path user.signingkey || :)
        conf_keyring=$(git config --path gcrypt.keyring || :)
-       conf_part=$(git config --get gcrypt.participants '.+' || :)
+       conf_part=$(git config --get "remote.$NAME.gcrypt-participants" '.+' ||
+                   git config --get gcrypt.participants '.+' || :)
 
        # Figure out which keys we should encrypt to or accept signatures from
        if isnonnull "$conf_keyring" && isnull "$conf_part"
@@ -339,6 +340,14 @@ read_config()
                --with-colons --fast-list -k | grep ^pub | cut -f 5 -d :)
        fi
 
+       if isnull "$conf_part" || iseq "$conf_part" simple
+       then
+               Signers="(default keyring)"
+               Recipients="--throw-keyids --default-recipient-self"
+               Goodsig="^\[GNUPG:\] GOODSIG "
+               return 0
+       fi
+
        for recp_ in $conf_part
        do
                key_line=$(gpg --with-colons --fast-list -k "$recp_" | xgrep ^pub)
@@ -662,7 +671,7 @@ EOF
        fi
 
        # Generate manifest
-       echo_info "Participants are: $Signers"
+       echo_info "Encrypting to: $Recipients"
        echo_info "Requesting manifest signature"
 
        TmpManifest_Enc="$Localdir/tmp_manifest.$$"