* Added configs annex.stalldetection-download, annex.stalldetection-upload,
annex.bwlimit-download, annex.bwlimit-upload,
and similar per-remote configs.
+ * Added --expected-present file matching option.
-- Joey Hess <id@joeyh.name> Fri, 29 Dec 2023 11:52:06 -0400
keyMatchingOptions' =
[ annexOption (setAnnexState . Limit.addIn) $ strOption
( long "in" <> short 'i' <> metavar paramRemote
- <> help "match files present in a remote"
+ <> help "match files present in a repository"
<> hidden
<> completeRemotes
)
<> help "match files that are locked"
<> hidden
)
+ , annexFlag (setAnnexState Limit.addExpectedPresent)
+ ( long "expected-present"
+ <> help "match files expected to be present"
+ <> hidden
+ )
]
-- Options to match files which may not yet be annexed.
then return False
else inAnnex key
+{- Limit to content that location tracking expects to be present
+ - in the current repository. Does not verify inAnnex. -}
+addExpectedPresent :: Annex ()
+addExpectedPresent = do
+ hereu <- getUUID
+ addLimit $ Right $ MatchFiles
+ { matchAction = const $ checkKey $ \key -> do
+ us <- Remote.keyLocations key
+ return $ hereu `elem` us
+ , matchNeedsFileName = False
+ , matchNeedsFileContent = False
+ , matchNeedsKey = True
+ , matchNeedsLocationLog = True
+ , matchDesc = matchDescSimple "expected-present"
+ }
+
{- Limit to content that is currently present on a uuid. -}
limitPresent :: Maybe UUID -> MatchFiles Annex
limitPresent u = MatchFiles
* `--in=repository`
Matches only when git-annex believes that the content is present in a
- repository. Note that it does not check the repository to verify
- that it still has the content.
+ repository.
The repository should be specified using the name of a configured remote,
or the UUID or description of a repository. For the current repository,
use `--in=here`
+
+ Note that this does not check remote repositories to verify that content
+ is still present on them. However, when checking the current repository,
+ it does verify that content is present in it.
* `--in=repository@{date}`
free up disk space. The next day, you can get back the files you dropped
using `git annex get . --in=here@{yesterday}`
+* `--expected-present`
+
+ Matches only when git-annex believes that the content is present
+ in the local repository.
+
+ This is like `--in=here`, except it does not verify that the content
+ is actually present. So it can be used in situations where the location
+ tracking information is known to be out of date.
+
+ For example, if a repository is being restored from a backup
+ that did not include the git-annex objects, this could be used to get
+ back all files that were expected to be in it:
+ `git-annex get --expected-present`
+
* `--copies=number`
Matches only when git-annex believes there are the specified number
files, and I wanted to get back the same objects. So I had to disable that
check. So an option that checks for files expected to be here would be
useful. --[[Joey]]
+
+> [[done]] as --expected-present --[[Joey]]