]> dgit.raspbian.org Git - git-annex.git/commitdiff
Added annex.adviceNoSshCaching config.
authorJoey Hess <joeyh@joeyh.name>
Thu, 27 May 2021 16:37:39 +0000 (12:37 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 27 May 2021 16:37:49 +0000 (12:37 -0400)
Sponsored-by: Brock Spratlen on Patreon
Annex/Ssh.hs
CHANGELOG
Types/GitConfig.hs
doc/forum/Help_with_git-annex_and_controlmaster/comment_5_0b4e2314c23df5eda18661c245f9f057._comment [new file with mode: 0644]
doc/git-annex.mdwn

index 50d52488521f2fe0ec6deb117895783726f036a3..2e45198fe576e1143daca7cd1751dda967662142 100644 (file)
@@ -118,9 +118,10 @@ sshCachingInfo (host, port) = go =<< sshCacheDir'
                        ConcurrentPerCpu -> warnnocaching whynocaching
                return (Nothing, [])
        
-       warnnocaching whynocaching = do
-               warning nocachingwarning
-               warning whynocaching
+       warnnocaching whynocaching =
+               whenM (annexAdviceNoSshCaching <$> Annex.getGitConfig) $ do
+                       warning nocachingwarning
+                       warning whynocaching
        
        nocachingwarning = unwords
                [ "You have enabled concurrency, but git-annex is not able"
index 6d8b0a5b7a99f4b26f63a41f117e31a621ae38fb..05b190b134cd3a37f769e26f4c91a43b3f2d041a 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -27,6 +27,7 @@ git-annex (8.20210429) UNRELEASED; urgency=medium
   * assistant: Fix a crash on startup by avoiding using forkProcess.
   * init: When annex.commitmessage is set, use that message for the commit
     that creates the git-annex branch.
+  * Added annex.adviceNoSshCaching config.
 
  -- Joey Hess <id@joeyh.name>  Mon, 03 May 2021 10:33:10 -0400
 
index 702dddd3549163d99997323a3a9fcffc72e0fd10..90e9eb54a0ff0efd0316ab5a633b27dd512a6ede 100644 (file)
@@ -139,6 +139,7 @@ data GitConfig = GitConfig
        , gpgCmd :: GpgCmd
        , mergeDirectoryRenames :: Maybe String
        , annexPrivateRepos :: S.Set UUID
+       , annexAdviceNoSshCaching :: Bool
        }
 
 extractGitConfig :: ConfigSource -> Git.Repo -> GitConfig
@@ -255,6 +256,7 @@ extractGitConfig configsource r = GitConfig
                        | otherwise = Nothing
                  in mapMaybe get (M.toList (Git.config r))
                ]
+       , annexAdviceNoSshCaching = getbool (annexConfig "adviceNoSshCaching") True
        }
   where
        getbool k d = fromMaybe d $ getmaybebool k
diff --git a/doc/forum/Help_with_git-annex_and_controlmaster/comment_5_0b4e2314c23df5eda18661c245f9f057._comment b/doc/forum/Help_with_git-annex_and_controlmaster/comment_5_0b4e2314c23df5eda18661c245f9f057._comment
new file mode 100644 (file)
index 0000000..e77202e
--- /dev/null
@@ -0,0 +1,11 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 5"""
+ date="2021-05-27T16:26:19Z"
+ content="""
+Seems to me that annex.jobs must be set in the git config for that message
+to be displayed as shown.
+
+I agree, it would make sense to have a way to disable the message.
+Added annex.adviceNoSshCaching
+"""]]
index 9f35f626108f1445a0753f39f61aba02142e0d7d..7cf8b43760cfd2b44ecf80a643cd8fd883f79611 100644 (file)
@@ -1002,6 +1002,15 @@ repository, using [[git-annex-config]]. See its man page for a list.)
   ControlMaster and ControlPersist settings
   (if built using a new enough ssh). To disable this, set to `false`.
 
+* `annex.adviceNoSshCaching`
+
+  When git-annex is unable to use ssh connection caching, or has been
+  configured not to, and concurrency is enabled, it will warn that
+  this might result in multiple ssh processes prompting for passwords
+  at the same time. To disable that warning, eg if you have configured ssh
+  connection caching yourself, or have ssh agent caching passwords, 
+  set this to `false`.
+
 * `annex.alwayscommit`
 
   By default, git-annex automatically commits data to the git-annex branch