From da0a1360d7b57d034620338996552752ab873045 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 17 Aug 2017 12:26:14 -0400 Subject: add annex-ignore-command and annex-sync-command configs Added remote configuration settings annex-ignore-command and annex-sync-command, which are dynamic equivilants of the annex-ignore and annex-sync configurations. For this I needed a new DynamicConfig infrastructure. Its implementation should be as fast as before when there is no dynamic config, and it caches so shell commands are only run once. Note that annex-ignore-command exits nonzero when the remote should be ignored. While that may seem backwards, it allows using the same command for it as for annex-sync-command when you want to disable both. This commit was sponsored by Trenton Cronholm on Patreon. --- Annex/SpecialRemote.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Annex') diff --git a/Annex/SpecialRemote.hs b/Annex/SpecialRemote.hs index 3e2b1da0a..f53a2ca63 100644 --- a/Annex/SpecialRemote.hs +++ b/Annex/SpecialRemote.hs @@ -10,6 +10,7 @@ module Annex.SpecialRemote where import Annex.Common import Remote (remoteTypes, remoteMap) import Types.Remote (RemoteConfig, RemoteConfigKey, SetupStage(..), typename, setup) +import Types.GitConfig import Logs.Remote import Logs.Trust import qualified Git.Config @@ -79,7 +80,8 @@ autoEnable = do case (M.lookup nameKey c, findType c) of (Just name, Right t) -> whenM (canenable u) $ do showSideAction $ "Auto enabling special remote " ++ name - res <- tryNonAsync $ setup t Enable (Just u) Nothing c def + dummycfg <- liftIO dummyRemoteGitConfig + res <- tryNonAsync $ setup t Enable (Just u) Nothing c dummycfg case res of Left e -> warning (show e) Right _ -> return () -- cgit v1.2.3