Improve error message display when autoinit fails

Due to eg, a permissions problem.
This commit is contained in:
Joey Hess 2021-12-09 14:38:12 -04:00
parent a62f2e141b
commit dbba231e06
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 9 additions and 1 deletions

View file

@ -200,7 +200,10 @@ ensureInitialized = getInitializedVersion >>= maybe needsinit checkUpgrade
where
needsinit = ifM autoInitializeAllowed
( do
initialize True Nothing Nothing
tryNonAsync (initialize True Nothing Nothing) >>= \case
Right () -> noop
Left e -> giveup $ show e ++ "\n" ++
"git-annex: automatic initialization failed due to above problems"
autoEnableSpecialRemotes
, giveup "First run: git-annex init"
)

View file

@ -9,6 +9,8 @@ git-annex (8.20211124) UNRELEASED; urgency=medium
* Fix locking problems when annex.pidlock is set and concurrency is
enabled eg with -J.
* Fix build with ghc 9.0.1
* Improve error message display when autoinit fails due to eg, a
permissions problem.
-- Joey Hess <id@joeyh.name> Tue, 23 Nov 2021 15:58:27 -0400

View file

@ -56,3 +56,6 @@ the issue is different from original but still might be worth addressing one way
[[!meta author=yoh]]
[[!tag projects/datalad]]
> added a note that the errors were encountered during autonit
> [[fixed|done]] --[[Joey]]