From c05c4e549e8fcf5050d37d38a561ae2ef0435869 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Apr 2020 16:08:45 -0400 Subject: [PATCH] sync: When some remotes to sync with are specified, and --fast is too, pick the lowest cost of the specified remotes Do not sync with a faster remote that was not specified. That old behavior was only documented in the changelog, and was certianly surprising. It also meant adding --fast made it slower.. --- CHANGELOG | 3 +++ Command/Sync.hs | 4 +--- ...nnex_sync__58___--fast_and_REMOTE_should_be_exclusive.mdwn | 2 ++ doc/git-annex-sync.mdwn | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 034b668278..cc01259c93 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -31,6 +31,9 @@ git-annex (8.20200331) UNRELEASED; urgency=medium git-annex enableremote is passed readonly=true. * Stop storing readonly=true in remote.log of external special remotes; it is a local setting only. + * sync: When some remotes to sync with are specified, and --fast is too, + pick the lowest cost of the specified remotes, do not sync with a + faster remote that was not specified. -- Joey Hess Mon, 30 Mar 2020 15:58:34 -0400 diff --git a/Command/Sync.hs b/Command/Sync.hs index 3a1e016344..ac19f6ab9f 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -291,10 +291,8 @@ syncRemotes ps = do syncRemotes' :: [String] -> [Remote] -> Annex [Remote] syncRemotes' ps available = - ifM (Annex.getState Annex.fast) ( nub <$> pickfast , wanted ) + ifM (Annex.getState Annex.fast) ( fastest <$> wanted , wanted ) where - pickfast = (++) <$> listed <*> (filterM good (fastest available)) - wanted | null ps = filterM good (concat $ Remote.byCost available) | otherwise = listed diff --git a/doc/bugs/git_annex_sync__58___--fast_and_REMOTE_should_be_exclusive.mdwn b/doc/bugs/git_annex_sync__58___--fast_and_REMOTE_should_be_exclusive.mdwn index 5afba36da6..9b82e0da29 100644 --- a/doc/bugs/git_annex_sync__58___--fast_and_REMOTE_should_be_exclusive.mdwn +++ b/doc/bugs/git_annex_sync__58___--fast_and_REMOTE_should_be_exclusive.mdwn @@ -22,3 +22,5 @@ I actually used `--fast` because I was annoyed by annex iterating over all files ### What version of git-annex are you using? On what operating system? 8.20200330, Debian testing + +> [[fixed|done]] --[[Joey]] diff --git a/doc/git-annex-sync.mdwn b/doc/git-annex-sync.mdwn index 0b5954ba2d..4fcdaaa0fd 100644 --- a/doc/git-annex-sync.mdwn +++ b/doc/git-annex-sync.mdwn @@ -46,6 +46,9 @@ received. Only sync with the remotes with the lowest annex-cost value configured. + When a list of remotes (or remote groups) is provided, it picks from + amoung those, otherwise it picks from amoung all remotes. + * `--only-annex` `-a`, `--not-only-annex` Only sync the git-annex branch and annexed content with remotes,