jump right to v8, don't stop part way
authorJoey Hess <joeyh@joeyh.name>
Mon, 24 Feb 2020 17:21:00 +0000 (13:21 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 24 Feb 2020 17:21:00 +0000 (13:21 -0400)
* init --version: When the version given is one that automatically
  upgrades to a newer version, use the newer version instead.
* Auto upgrades from older repo versions, like v5, now jump right to v8.

Annex/Version.hs
CHANGELOG
doc/bugs/__39__init_--version__61__N__39___can_land_on_unsupported_N+1.mdwn
doc/bugs/__39__init_--version__61__N__39___can_land_on_unsupported_N+1/comment_1_c67521dc54f12efbbf7e13c828775e30._comment [new file with mode: 0644]
doc/git-annex-init.mdwn

index df9ac1514c6601be5a65e42f440c8e50be38fbf2..b3d42c7f098c9614ccaffdba474d79d01b43d72a 100644 (file)
@@ -36,11 +36,11 @@ upgradableVersions = map RepoVersion [2..7]
 
 autoUpgradeableVersions :: M.Map RepoVersion RepoVersion
 autoUpgradeableVersions = M.fromList
-       [ (RepoVersion 3, RepoVersion 5)
-       , (RepoVersion 4, RepoVersion 5)
-       , (RepoVersion 5, RepoVersion 6)
-       , (RepoVersion 6, RepoVersion 7)
-       , (RepoVersion 7, RepoVersion 8)
+       [ (RepoVersion 3, latestVersion)
+       , (RepoVersion 4, latestVersion)
+       , (RepoVersion 5, latestVersion)
+       , (RepoVersion 6, latestVersion)
+       , (RepoVersion 7, latestVersion)
        ]
 
 versionField :: ConfigKey
index c80b06eb85a2e1f4bcb918790d81fe2c0a75fcac..4891d6bcff4902a1b468ac508e94c9af50962a36 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -29,6 +29,9 @@ git-annex (8.20200221) UNRELEASED; urgency=medium
     on the locale.
   * annex.maxextensionlength used to be the number of characters, not
     bytes, when in a utf-8 locale. It's now always the number of bytes.
+  * init --version: When the version given is one that automatically
+    upgrades to a newer version, use the newer version instead.
+  * Auto upgrades from older repo versions, like v5, now jump right to v8.
 
  -- Joey Hess <id@joeyh.name>  Wed, 19 Feb 2020 12:48:58 -0400
 
index 035ca3c76cbb93090f702937d17fac85ce2f61fd..12e48c4ebb8d92cceec859c49efde51ea7fb233f 100644 (file)
@@ -49,3 +49,5 @@ lucky and it's passable Haskell, I'd be happy to send a patch.
 
 [[!meta author=kyle]]
 [[!tag projects/datalad]]
+
+> [[fixed|done]] --[[Joey]]
diff --git a/doc/bugs/__39__init_--version__61__N__39___can_land_on_unsupported_N+1/comment_1_c67521dc54f12efbbf7e13c828775e30._comment b/doc/bugs/__39__init_--version__61__N__39___can_land_on_unsupported_N+1/comment_1_c67521dc54f12efbbf7e13c828775e30._comment
new file mode 100644 (file)
index 0000000..70e8078
--- /dev/null
@@ -0,0 +1,23 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2020-02-24T17:13:45Z"
+ content="""
+Your patch is perfectly fine haskell code.
+
+But, looking at it, the problem is deeper than init --version.
+Running git-annex in a v3 repo produces a v5 repo,
+then running git-annex again produces a v6 repo,
+then v7, then v8.
+
+So the problem is really that autoUpgradeableVersions
+should map everything to latestVersion. At least currently,
+since all versions should be upgraded to v8.
+
+(Really it could just be a list of versions that all
+are assumed to upgrade to latestVersion, but I left it a map
+in case at some point there are two concurrent version
+tracks without an autoupgrade between them.)
+
+Anyway, attach a git format-patch next time so I can git am it. :)
+"""]]
index 4538f54e50ecb77980f1ff52d059ec78c300144d..966b03938900811a2a849c4eaa8e31e01158dbb9 100644 (file)
@@ -36,6 +36,9 @@ to the user who tries to run git-annex init.
   Force the repository to be initialized using a different annex.version
   than the current default.
 
+  When the version given is one that automatically upgrades to a newer
+  version, it will automatically use the newer version instead.
+
 # SEE ALSO
 
 [[git-annex]](1)