]> Nutra Git (v1) - gamesguru/git-remote-gcrypt.git/commitdiff
add remote.<name>.gcrypt-signingkey config
authorJoey Hess <joey@kitenet.net>
Tue, 17 Sep 2013 19:30:25 +0000 (15:30 -0400)
committerJoey Hess <joey@kitenet.net>
Tue, 17 Sep 2013 19:30:25 +0000 (15:30 -0400)
This is needed by git-annex assistant when it sets up a gcrypt repository,
to ensure that the gpg key it was asked to use to encrypt the repo is the
same key used to sign it. If it's not, pulling from the repo won't work,
due to git-remote-gcrypt's "Only accepting signatories" check.

The user may have a global user.signingkey setting (I do), but be setting
up a different special-purpose key for encrypting their git repo. The
git-annex assistant cannot mess with the global value, so needs this to
override it.

README.rst
git-remote-gcrypt

index f177913779dadde9a35509c54549379185edec4a..6fc46368ca57b60abfc3a5046b1b487b1ebfd1ac 100644 (file)
@@ -60,10 +60,13 @@ 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-signingkey``
+    ..
 ``user.signingkey``
-    (From regular git configuration) The key to use for signing.  You
-    should set ``user.signingkey`` if your default signing key is not
-    part of the participant list.
+    (The latter from regular git configuration) The key to use for signing.
+    You should set ``user.signingkey`` if your default signing key is not
+    part of the participant list. You may use the per-remote version
+    to sign different remotes using different keys.
 
 Environment Variables
 =====================
index 182c5cb7c09e06cb076ffbc74fab4f5fbe75a210..bf757777b480e742d4bc0fd4bd0780ecbe5a659a 100755 (executable)
@@ -389,7 +389,8 @@ make_new_repo()
 read_config()
 {
        local recp_= r_keyinfo= cap_= conf_part= good_sig= signers_=
-       Conf_signkey=$(git config --path user.signingkey || :)
+       Conf_signkey=$(git config --get "remote.$NAME.gcrypt-signingkey" '.+' ||
+               git config --path user.signingkey || :)
        conf_part=$(git config --get "remote.$NAME.gcrypt-participants" '.+' ||
                    git config --get gcrypt.participants '.+' || :)