Change git annex info remote encryption description to use wording closer to what's used in initremote.

This commit is contained in:
Joey Hess 2016-05-11 16:09:39 -04:00
parent 695fa2ea3e
commit 7cacd7888b
Failed to extract signature
3 changed files with 25 additions and 17 deletions

View file

@ -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 ++ ")"
describeCipher :: StorableCipher -> [String]
nameCipher :: StorableCipher -> String
nameCipher (SharedCipher _) = "shared"
nameCipher (EncryptedCipher _ PubKey _) = "pubkey"
nameCipher (EncryptedCipher _ Hybrid _) = "hybrid"
nameCipher (SharedPubKeyCipher _ _) = "sharedpubkey"
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

7
debian/changelog vendored
View file

@ -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

View file

@ -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