summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-05-11 16:09:39 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-05-11 16:09:39 -0400
commit1b030931d6ac9dd34a9a67483adb6037c23b5ff2 (patch)
tree34d32d58a101de865ea771081ae36c0ea651b5e1
parent716e10dce7aa55b01dbeb14b34bb0b00bce6eb18 (diff)
Change git annex info remote encryption description to use wording closer to what's used in initremote.
-rw-r--r--Remote/Helper/Encryptable.hs30
-rw-r--r--debian/changelog7
-rw-r--r--doc/encryption.mdwn5
3 files changed, 25 insertions, 17 deletions
diff --git a/Remote/Helper/Encryptable.hs b/Remote/Helper/Encryptable.hs
index 46ce57dc1..5ea4f1090 100644
--- a/Remote/Helper/Encryptable.hs
+++ b/Remote/Helper/Encryptable.hs
@@ -87,7 +87,7 @@ encryptionSetup c = do
use m a = do
showNote m
cipher <- liftIO a
- mapM_ showNote (describeCipher cipher)
+ showNote (describeCipher cipher)
return (storeCipher cipher c', EncryptionIsSetup)
highRandomQuality =
(&&) (maybe True ( /= "false") $ M.lookup "highRandomQuality" c)
@@ -169,24 +169,20 @@ extractCipher c = case (M.lookup "cipher" c,
describeEncryption :: RemoteConfig -> String
describeEncryption c = case extractCipher c of
- Nothing -> "not encrypted"
- Just cip -> "encrypted " ++ unwords (map paren (describeCipher cip))
- where
- paren s = "(" ++ s ++ ")"
+ Nothing -> "none"
+ Just cip -> nameCipher cip ++ " (" ++ describeCipher cip ++ ")"
+
+nameCipher :: StorableCipher -> String
+nameCipher (SharedCipher _) = "shared"
+nameCipher (EncryptedCipher _ PubKey _) = "pubkey"
+nameCipher (EncryptedCipher _ Hybrid _) = "hybrid"
+nameCipher (SharedPubKeyCipher _ _) = "sharedpubkey"
-describeCipher :: StorableCipher -> [String]
+describeCipher :: StorableCipher -> String
describeCipher c = case c of
- (SharedCipher _) -> ["encryption key stored in git repository"]
- (EncryptedCipher _ v ks) -> catMaybes
- [ Just $ showkeys ks
- , case v of
- PubKey -> Nothing
- Hybrid -> Just "hybrid mode"
- ]
- (SharedPubKeyCipher _ ks) ->
- [ showkeys ks
- , "shared cipher"
- ]
+ (SharedCipher _) -> "encryption key stored in git repository"
+ (EncryptedCipher _ _ ks) -> showkeys ks
+ (SharedPubKeyCipher _ ks) -> showkeys ks
where
showkeys (KeyIds { keyIds = ks }) = "to gpg keys: " ++ unwords ks
diff --git a/debian/changelog b/debian/changelog
index ab2362703..3c0ee51a0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+git-annex (6.20160512) UNRELEASED; urgency=medium
+
+ * Change git annex info remote encryption description to use wording
+ closer to what's used in initremote.
+
+ -- Joey Hess <id@joeyh.name> Wed, 11 May 2016 16:08:38 -0400
+
git-annex (6.20160511) unstable; urgency=medium
* Fix bug that sometimes prevented git-annex smudge --clean from consuming
diff --git a/doc/encryption.mdwn b/doc/encryption.mdwn
index f3929aa67..ddde431b1 100644
--- a/doc/encryption.mdwn
+++ b/doc/encryption.mdwn
@@ -25,6 +25,11 @@ to disable encryption. To use encryption, you run
* `git annex initremote newremote type=... encryption=pubkey keyid=KEYID`
* `git annex initremote newremote type=... encryption=sharedpubkey keyid=KEYID`
+To see what encryption is used for a special remote, run
+`git annex info $remote` and look for a line like:
+
+ encryption: hybrid (to gpg keys: AEC828149D85C538 C910D9122512E3C8)
+
## hybrid encryption keys (encryption=hybrid)
The [[hybrid_key_design|design/encryption]] allows additional