diff options
author | Joey Hess <joeyh@joeyh.name> | 2018-08-01 14:22:52 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2018-08-01 14:28:05 -0400 |
commit | fd5a392006842f0670e0addcc9e0963e392ee625 (patch) | |
tree | b8a7d1cb601956fe807bcf7682ebc36227b250c0 /Types | |
parent | 2884637cab2a1cf7f98f164bcfc25c1a4190255c (diff) |
cache remotes via annex-speculate-present
Added remote.name.annex-speculate-present config that can be used to
make cache remotes.
Implemented it in Remote.keyPossibilities, which is used by the
get/move/copy/mirror commands, and nothing else. This way, things like
whereis will not show content that's speculatively present.
The assistant and sync --content were not using Remote.keyPossibilities,
and were changed to use it.
The efficiency hit should be small; Remote.keyPossibilities is only
used before transferring a file, which is the expensive operation.
And, it's only doing one lookup of the remoteList and a very cheap
filter over it.
Note that, git-annex still updates the location log when copying content
to a remote with annex-speculate-present set. In this case, the location
tracking will indicate that content is present in the remote. This may
not be wanted for caches, or may not be a real problem for them. TBD.
This commit was supported by the NSF-funded DataLad project.
Diffstat (limited to 'Types')
-rw-r--r-- | Types/GitConfig.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Types/GitConfig.hs b/Types/GitConfig.hs index 26ad354c8d..4475abf58b 100644 --- a/Types/GitConfig.hs +++ b/Types/GitConfig.hs @@ -226,6 +226,7 @@ data RemoteGitConfig = RemoteGitConfig , remoteAnnexStartCommand :: Maybe String , remoteAnnexStopCommand :: Maybe String , remoteAnnexAvailability :: Maybe Availability + , remoteAnnexSpeculatePresent :: Bool , remoteAnnexBare :: Maybe Bool , remoteAnnexRetry :: Maybe Integer , remoteAnnexRetryDelay :: Maybe Seconds @@ -281,6 +282,7 @@ extractRemoteGitConfig r remotename = do , remoteAnnexStartCommand = notempty $ getmaybe "start-command" , remoteAnnexStopCommand = notempty $ getmaybe "stop-command" , remoteAnnexAvailability = getmayberead "availability" + , remoteAnnexSpeculatePresent = getbool "speculate-present" False , remoteAnnexBare = getmaybebool "bare" , remoteAnnexRetry = getmayberead "retry" , remoteAnnexRetryDelay = Seconds |