verifiableCopies :: Key -> [UUID] -> Annex ([UnVerifiedCopy], [VerifiedCopy])
verifiableCopies key exclude = do
locs <- Remote.keyLocations key
- (remotes, trusteduuids) <- Remote.remoteLocations locs
+ (remotes, trusteduuids) <- Remote.remoteLocations (Remote.IncludeIgnored False) locs
=<< trustGet Trusted
untrusteduuids <- trustGet UnTrusted
let exclude' = exclude ++ untrusteduuids
filter (\r -> not (inset s r || Remote.readonly r))
(syncDataRemotes st)
where
- locs = S.fromList . map Remote.uuid <$> Remote.keyPossibilities k
+ locs = S.fromList . map Remote.uuid <$> Remote.keyPossibilities (Remote.IncludeIgnored False) k
inset s r = S.member (Remote.uuid r) s
gentransfer r = Transfer
{ transferDirection = direction
+git-annex (10.20231130) UNRELEASED; urgency=medium
+
+ * Make git-annex get/copy/move --from foo override configuration of
+ remote.foo.annex-ignore, as documented.
+
+ -- Joey Hess <id@joeyh.name> Thu, 30 Nov 2023 14:48:12 -0400
+
git-annex (10.20231129) upstream; urgency=medium
* Fix bug in git-annex copy --from --to that skipped files that were
check ks mr = case mr of
Just r -> go Nothing [r]
Nothing -> do
- mostlikely <- Remote.keyPossibilities k
+ mostlikely <- Remote.keyPossibilities (Remote.IncludeIgnored False) k
otherremotes <- flip Remote.remotesWithoutUUID
(map Remote.uuid mostlikely)
<$> remoteList
{- Try to find a copy of the file in one of the remotes,
- and copy it to here. -}
getKey :: Key -> AssociatedFile -> Annex Bool
-getKey key afile = getKey' key afile =<< Remote.keyPossibilities key
+getKey key afile = getKey' key afile
+ =<< Remote.keyPossibilities (Remote.IncludeIgnored False) key
getKey' :: Key -> AssociatedFile -> [Remote] -> Annex Bool
getKey' key afile = dispatch
expectedPresent :: Remote -> Key -> Annex Bool
expectedPresent dest key = do
- remotes <- Remote.keyPossibilities key
+ remotes <- Remote.keyPossibilities (Remote.IncludeIgnored True) key
return $ dest `elem` remotes
toPerform :: Remote -> RemoveWhen -> Key -> AssociatedFile -> Bool -> Either String Bool -> CommandPerform
where
checklog = do
u <- getUUID
- remotes <- Remote.keyPossibilities key
+ remotes <- Remote.keyPossibilities (Remote.IncludeIgnored True) key
return $ u /= Remote.uuid src && elem src remotes
fromPerform :: Remote -> RemoveWhen -> Key -> AssociatedFile -> CommandPerform
toHereStart :: RemoveWhen -> AssociatedFile -> Key -> ActionItem -> SeekInput -> CommandStart
toHereStart removewhen afile key ai si =
startingNoMessage (OnlyActionOn key ai) $ do
- rs <- Remote.keyPossibilities key
+ rs <- Remote.keyPossibilities (Remote.IncludeIgnored False) key
forM_ rs $ \r ->
includeCommandAction $
starting (describeMoveAction removewhen) ai si $
syncFile :: SyncOptions -> Either (Maybe (Bloom Key)) (Key -> Annex ()) -> [Remote] -> AssociatedFile -> Key -> Annex Bool
syncFile o ebloom rs af k = do
inhere <- inAnnex k
- locs <- map Remote.uuid <$> Remote.keyPossibilities k
+ locs <- map Remote.uuid <$> Remote.keyPossibilities (Remote.IncludeIgnored False) k
let (have, lack) = partition (\r -> Remote.uuid r `elem` locs) rs
got <- anyM id =<< handleget have inhere
remotesWithUUID,
remotesWithoutUUID,
keyLocations,
+ IncludeIgnored(..),
keyPossibilities,
remoteLocations,
nameToUUID,
keyLocations :: Key -> Annex [UUID]
keyLocations key = trustExclude DeadTrusted =<< loggedLocations key
+{- Whether to include remotes that have annex-ignore set. -}
+newtype IncludeIgnored = IncludeIgnored Bool
+
{- Cost ordered lists of remotes that the location log indicates
- may have a key.
-
- Also includes remotes with remoteAnnexSpeculatePresent set.
-}
-keyPossibilities :: Key -> Annex [Remote]
-keyPossibilities key = do
+keyPossibilities :: IncludeIgnored -> Key -> Annex [Remote]
+keyPossibilities ii key = do
u <- getUUID
-- uuids of all remotes that are recorded to have the key
locations <- filter (/= u) <$> keyLocations key
-- there are unlikely to be many speclocations, so building a Set
-- is not worth the expense
let locations' = speclocations ++ filter (`notElem` speclocations) locations
- fst <$> remoteLocations locations' []
+ fst <$> remoteLocations ii locations' []
{- Given a list of locations of a key, and a list of all
- trusted repositories, generates a cost-ordered list of
- remotes that contain the key, and a list of trusted locations of the key.
-}
-remoteLocations :: [UUID] -> [UUID] -> Annex ([Remote], [UUID])
-remoteLocations locations trusted = do
+remoteLocations :: IncludeIgnored -> [UUID] -> [UUID] -> Annex ([Remote], [UUID])
+remoteLocations (IncludeIgnored ii) locations trusted = do
let validtrustedlocations = nub locations `intersect` trusted
-- remotes that match uuids that have the key
allremotes <- remoteList
- >>= filterM (not <$$> liftIO . getDynamicConfig . remoteAnnexIgnore . gitconfig)
+ >>= if not ii
+ then filterM (not <$$> liftIO . getDynamicConfig . remoteAnnexIgnore . gitconfig)
+ else return
let validremotes = remotesWithUUID allremotes locations
return (sortBy (comparing cost) validremotes, validtrustedlocations)
* `remote.<name>.annex-ignore`
- If set to `true`, prevents git-annex
- from storing annexed file contents on this remote by default.
- (You can still request it be used by the `--from` and `--to` options.)
+ If set to `true`, prevents git-annex from storing or retrieving annexed
+ file contents on this remote by default.
+ (You can still request it be used with the `--from` and `--to` options.)
This is, for example, useful if the remote is located somewhere
without git-annex-shell. (For example, if it's on GitHub).
This does not prevent `git-annex sync`, `git-annex pull`, `git-annex push`,
`git-annex assist` or the `git-annex assistant` from operating on the
- git repository.
+ git repository. It only affects annexed content.
* `remote.<name>.annex-ignore-command`