diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs index 50d5248852..2e45198fe5 100644 --- a/Annex/Ssh.hs +++ b/Annex/Ssh.hs @@ -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" diff --git a/CHANGELOG b/CHANGELOG index 6d8b0a5b7a..05b190b134 100644 --- 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 Mon, 03 May 2021 10:33:10 -0400 diff --git a/Types/GitConfig.hs b/Types/GitConfig.hs index 702dddd354..90e9eb54a0 100644 --- a/Types/GitConfig.hs +++ b/Types/GitConfig.hs @@ -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 index 0000000000..e77202e7af --- /dev/null +++ b/doc/forum/Help_with_git-annex_and_controlmaster/comment_5_0b4e2314c23df5eda18661c245f9f057._comment @@ -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 +"""]] diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index 9f35f62610..7cf8b43760 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -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