2022-01-11 18:52:50 +00:00
|
|
|
{- git-annex v8 -> v9 upgrade support
|
|
|
|
-
|
|
|
|
- Copyright 2022 Joey Hess <id@joeyh.name>
|
|
|
|
-
|
|
|
|
- Licensed under the GNU AGPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Upgrade.V8 where
|
|
|
|
|
|
|
|
import Annex.Common
|
2022-01-19 17:06:31 +00:00
|
|
|
import Types.Upgrade
|
enable filter.annex.process in v9
This has tradeoffs, but is generally a win, and users who it causes git add to
slow down unacceptably for can just disable it again.
It needed to happen in an upgrade, since there are git-annex versions
that do not support it, and using such an old version with a v8
repository with filter.annex.process set will cause bad behavior.
By enabling it in v9, it's guaranteed that any git-annex version that
can use the repository does support it. Although, this is not a perfect
protection against problems, since an old git-annex version, if it's
used with a v9 repository, will cause git add to try to run
git-annex filter-process, which will fail. But at least, the user is
unlikely to have an old git-annex in path if they are using a v9
repository, since it won't work in that repository.
Sponsored-by: Dartmouth College's Datalad project
2022-01-21 17:11:18 +00:00
|
|
|
import Config.Smudge
|
2022-01-11 18:52:50 +00:00
|
|
|
|
2022-01-19 17:06:31 +00:00
|
|
|
upgrade :: Bool -> Annex UpgradeResult
|
2022-01-11 18:52:50 +00:00
|
|
|
upgrade automatic = do
|
2022-01-19 19:51:04 +00:00
|
|
|
unless automatic $
|
|
|
|
showAction "v8 to v9"
|
2022-01-11 18:52:50 +00:00
|
|
|
|
enable filter.annex.process in v9
This has tradeoffs, but is generally a win, and users who it causes git add to
slow down unacceptably for can just disable it again.
It needed to happen in an upgrade, since there are git-annex versions
that do not support it, and using such an old version with a v8
repository with filter.annex.process set will cause bad behavior.
By enabling it in v9, it's guaranteed that any git-annex version that
can use the repository does support it. Although, this is not a perfect
protection against problems, since an old git-annex version, if it's
used with a v9 repository, will cause git add to try to run
git-annex filter-process, which will fail. But at least, the user is
unlikely to have an old git-annex in path if they are using a v9
repository, since it won't work in that repository.
Sponsored-by: Dartmouth College's Datalad project
2022-01-21 17:11:18 +00:00
|
|
|
configureSmudgeFilterProcess
|
|
|
|
|
2022-01-19 19:51:04 +00:00
|
|
|
return UpgradeSuccess
|