From 084b502c7a521f7d5eff2fc9329ea7615124c4e1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Sep 2020 13:56:27 -0400 Subject: [PATCH] httpalso: Support being used with special remotes that do not have encryption= in their config. --- CHANGELOG | 2 ++ Remote/HttpAlso.hs | 4 +++- doc/bugs/httpalso_mode_expects_encryption.mdwn | 2 ++ ...t_4_50edcdec6ba08fc739f5c2f4ba826191._comment | 16 ++++++++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 doc/bugs/httpalso_mode_expects_encryption/comment_4_50edcdec6ba08fc739f5c2f4ba826191._comment diff --git a/CHANGELOG b/CHANGELOG index 3f69e857bb..6dbe6c6d5a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -32,6 +32,8 @@ git-annex (8.20200909) UNRELEASED; urgency=medium (Other special remotes may support this later as well.) * addurl: Avoid a redundant git ignores check for speed. * upgrade: Avoid an upgrade failure of a bare repo in unusual circumstances. + * httpalso: Support being used with special remotes that do not have + encryption= in their config. -- Joey Hess Mon, 14 Sep 2020 18:34:37 -0400 diff --git a/Remote/HttpAlso.hs b/Remote/HttpAlso.hs index 4e71e1ad85..9411f3a842 100644 --- a/Remote/HttpAlso.hs +++ b/Remote/HttpAlso.hs @@ -105,7 +105,9 @@ httpAlsoSetup _ (Just u) _ c gc = do _url <- maybe (giveup "Specify url=") (return . fromProposedAccepted) (M.lookup urlField c) - (c', _encsetup) <- encryptionSetup c gc + c' <- if isJust (M.lookup encryptionField c) + then fst <$> encryptionSetup c gc + else pure c gitConfigSpecialRemote u c' [("httpalso", "true")] return (c', u) diff --git a/doc/bugs/httpalso_mode_expects_encryption.mdwn b/doc/bugs/httpalso_mode_expects_encryption.mdwn index fa2391d94c..25557c434d 100644 --- a/doc/bugs/httpalso_mode_expects_encryption.mdwn +++ b/doc/bugs/httpalso_mode_expects_encryption.mdwn @@ -40,3 +40,5 @@ git annex 8.20200908 on current Debian sid (as packaged) My first git-annex repository dates back 2010-12-21 ... so: yes. The introduction of httpalso simplifies the setup in the [annex-to-web](https://gitlab.com/chrysn/annex-to-web) server, which on one hand consumes them in order to pass out redirects, and on the other hand . + +> [[fixed|done]] to the extent this was a bug at all. --[[Joey]] diff --git a/doc/bugs/httpalso_mode_expects_encryption/comment_4_50edcdec6ba08fc739f5c2f4ba826191._comment b/doc/bugs/httpalso_mode_expects_encryption/comment_4_50edcdec6ba08fc739f5c2f4ba826191._comment new file mode 100644 index 0000000000..80c1407eed --- /dev/null +++ b/doc/bugs/httpalso_mode_expects_encryption/comment_4_50edcdec6ba08fc739f5c2f4ba826191._comment @@ -0,0 +1,16 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 4""" + date="2020-09-29T17:52:03Z" + content=""" +Made it check if the inherited config has encryption and skip setting it +up. So if there is a special remote that does not support encryption +config, it won't fail this way. + +Come to think, at least tahoe does not support encryption config. +Although it seems very unlikely it would be useful combined with tahoe. + +Of course, it still won't, and cannot possibly work when combined with a +http export of a git working tree. But then the docs are clear it won't +work with everything. +"""]] -- 2.30.2