]> dgit.raspbian.org Git - git-annex.git/commitdiff
v8 repositories automatically upgrade to v9
authorJoey Hess <joeyh@joeyh.name>
Mon, 25 Jul 2022 20:09:11 +0000 (16:09 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 25 Jul 2022 20:20:04 +0000 (16:20 -0400)
(And v9 later on to v10.)

When v9/v10 were added, making v8 automatically upgrade was deferred
"for a few months" to prevent interoperability problems if users also
have an old version of git-annex. Of course that could still be the
case, but there has been a good amount of time and this can't be put off
forever.

Allow setting annex.autoupgraderepository to false to avoid this upgrade.
Previously, that only prevented upgrades from no longer supported git-annex
versions, but v8 is still supported, and users may want to keep on v8 to
interoperate with an old git-annex version.

Sponsored-by: Boyd Stephen Smith Jr. on Patreon
Annex/Version.hs
CHANGELOG
Upgrade.hs
doc/git-annex.mdwn
doc/upgrades.mdwn

index 958e52a834542f1e64aee1eee42e790409db832c..c3504cfd934277d0bf1bb3abdd183c0aa42fdb82 100644 (file)
@@ -19,7 +19,7 @@ import qualified Annex
 import qualified Data.Map as M
 
 defaultVersion :: RepoVersion
-defaultVersion = RepoVersion 8
+defaultVersion = RepoVersion 10
 
 latestVersion :: RepoVersion
 latestVersion = RepoVersion 10
@@ -42,7 +42,7 @@ autoUpgradeableVersions = M.fromList
        , (RepoVersion 6, defaultVersion)
        , (RepoVersion 7, defaultVersion)
        , (RepoVersion 8, defaultVersion)
-       , (RepoVersion 9, latestVersion)
+       , (RepoVersion 9, defaultVersion)
        ]
 
 versionField :: ConfigKey
index aefdd7b49bc41e57f68b3217957a000c465e498c..5def79db9f801b6951ab5e5f1c2022c8b7a6080b 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,12 @@
+git-annex (10.20220725) UNRELEASED; urgency=medium
+
+  * v8 repositories automatically upgrade to v9, which will in turn
+    automatically upgrade to v10 in a year's time.
+    To avoid this upgrade, you can set annex.autoupgraderepository to false.
+  * Use v10 by default for new repositories.
+
+ -- Joey Hess <id@joeyh.name>  Mon, 25 Jul 2022 15:35:45 -0400
+
 git-annex (10.20220724) upstream; urgency=medium
 
   * filter-process: Fix a bug involving handling of empty files,
index 01daa3a327180a8be949d7d936c3bbbbd8bdb352..2073b1bec085f1edd8c95bb70c89b2d51a3c2c92 100644 (file)
@@ -39,7 +39,12 @@ checkUpgrade = maybe noop giveup <=< needsUpgrade
 
 needsUpgrade :: RepoVersion -> Annex (Maybe String)
 needsUpgrade v
-       | v `elem` supportedVersions = ok
+       | v `elem` supportedVersions = case M.lookup v autoUpgradeableVersions of
+               Just newv | newv /= v -> ifM (annexAutoUpgradeRepository <$> Annex.getGitConfig)
+                       ( runupgrade newv
+                       , ok
+                       )
+               _ -> ok
        | otherwise = case M.lookup v autoUpgradeableVersions of
                Nothing
                        | v `elem` upgradeableVersions ->
@@ -47,10 +52,7 @@ needsUpgrade v
                        | otherwise ->
                                err "Upgrade git-annex."
                Just newv -> ifM (annexAutoUpgradeRepository <$> Annex.getGitConfig)
-                       ( tryNonAsync (upgrade True newv) >>= \case
-                               Right True -> ok
-                               Right False -> err "Automatic upgrade failed!"
-                               Left ex -> err $ "Automatic upgrade exception! " ++ show ex
+                       ( runupgrade newv
                        , err "Automatic upgrade is disabled by annex.autoupgraderepository configuration. To upgrade this repository: git-annex upgrade"
                        )
   where
@@ -63,8 +65,14 @@ needsUpgrade v
                        , show (fromRepoVersion v) ++ "."
                        , msg
                        ]
+       
        ok = return Nothing
 
+       runupgrade newv = tryNonAsync (upgrade True newv) >>= \case
+               Right True -> ok
+               Right False -> err "Automatic upgrade failed!"
+               Left ex -> err $ "Automatic upgrade exception! " ++ show ex
+
 upgrade :: Bool -> RepoVersion -> Annex Bool
 upgrade automatic destversion = do
        startversion <- getVersion
index 34c3ba7f60577f23a873e13395ed4214c3443b2f..a53f7bf7eb35e518a27f3db04b828d5e257d9ef8 100644 (file)
@@ -1181,13 +1181,18 @@ repository, using [[git-annex-config]]. See its man page for a list.)
 
 * `annex.autoupgraderepository`
 
-  When an old git-annex repository version has become deprecated,
+  When an old git-annex repository version is no longer supported,
   git-annex will normally automatically upgrade the repository to
-  the new version.
+  the new version. It may also sometimes upgrade from an old repository
+  version that is still supported but that is not as good as a later
+  version.
 
   If this is set to false, git-annex won't automatically upgrade the
-  repository. Instead it will exit with an error message. You can run
-  `git annex upgrade` yourself when you are ready to upgrade the
+  repository. If the repository version is not supported, git-annex
+  will instead exit with an error message. If it is still supported,
+  git-annex will continue to work.
+
+  You can run `git annex upgrade` yourself when you are ready to upgrade the
   repository.
 
 * `annex.crippledfilesystem`
index 836f922b85a03aa3d17f4cd011db8b20c8ce1ee3..7d48547d82d42c0867bcd6b9db2d7b47c5dca055 100644 (file)
@@ -61,12 +61,15 @@ it very unlikely that such a process is still running.
 
 ## v8 -> v9 (git-annex version 10.x)
 
-v8 repositories are not yet automatically upgraded to v9.
+v8 repositories are automatically upgraded to v9.
 
 v9 is a stepping stone to the v10 upgrade. By adding this intermediate
 version, old versions of git-annex that only support v8 will not be able to
 start new processes in the repository after the v9 upgrade.
 
+v9 also enables using `git-annex filter-process`. This can significantly
+speed up git operations involving unlocked files.
+
 ## v7 -> v8 (git-annex version 8.x)
 
 v7 repositories are automatically upgraded to v8.
@@ -95,7 +98,7 @@ dotfiles to git by default, unless annex.dotfiles is set to true.
 v6 repositories are automatically upgraded to v7.
 
 The only difference between v6 and v7 is that some additional git hooks
-were added in v7. See below for details about what's new in v6/v7.
+were added in v7.
 
 ## v5 -> v6 (git-annex version 6.x)