summaryrefslogtreecommitdiff
path: root/Types
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-02-03 14:31:17 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-02-03 14:31:17 -0400
commitc438a610208b1914932980a26c0ab90fb544cd34 (patch)
tree1c204beae009ae2b5351f0eb4e865abef09545ba /Types
parent4cded2bc85d530dd335738cb870daf3a2d4e4a2f (diff)
New annex.synccontent config setting
.. which can be set to true to make git annex sync default to --content. This may become the default at some point in the future. As well as being configuable by git config, it can be configured by git-annex config to control the default behavior in all clones of a repository. Had to add a separate --no-content switch to we can tell if it's been explicitly set, and should override annex.synccontent. If --content was the default, this complication would not be necessary. This commit was sponsored by Jake Vosloo on Patreon.
Diffstat (limited to 'Types')
-rw-r--r--Types/GitConfig.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Types/GitConfig.hs b/Types/GitConfig.hs
index b972697d7..fb25f2f26 100644
--- a/Types/GitConfig.hs
+++ b/Types/GitConfig.hs
@@ -38,6 +38,7 @@ data Configurable a
| DefaultConfig a
-- ^ A default value is known, but not all config sources
-- have been read yet.
+ deriving (Show)
{- Main git-annex settings. Each setting corresponds to a git-config key
- such as annex.foo -}
@@ -57,6 +58,7 @@ data GitConfig = GitConfig
, annexHttpHeaders :: [String]
, annexHttpHeadersCommand :: Maybe String
, annexAutoCommit :: Configurable Bool
+ , annexSyncContent :: Configurable Bool
, annexDebug :: Bool
, annexWebOptions :: [String]
, annexQuviOptions :: [String]
@@ -105,6 +107,8 @@ extractGitConfig r = GitConfig
, annexHttpHeadersCommand = getmaybe (annex "http-headers-command")
, annexAutoCommit = configurable True $
getmaybebool (annex "autocommit")
+ , annexSyncContent = configurable False $
+ getmaybebool (annex "synccontent")
, annexDebug = getbool (annex "debug") False
, annexWebOptions = getwords (annex "web-options")
, annexQuviOptions = getwords (annex "quvi-options")
@@ -156,6 +160,7 @@ extractGitConfig r = GitConfig
mergeGitConfig :: GitConfig -> GitConfig -> GitConfig
mergeGitConfig gitconfig repoglobals = gitconfig
{ annexAutoCommit = merge annexAutoCommit
+ , annexSyncContent = merge annexSyncContent
}
where
merge f = case f gitconfig of