From dbba231e063f14fdad835eb92ec252dc44b07add Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 9 Dec 2021 14:38:12 -0400 Subject: [PATCH] Improve error message display when autoinit fails Due to eg, a permissions problem. --- Annex/Init.hs | 5 ++++- CHANGELOG | 2 ++ doc/bugs/wanted_on_read-only_repo_crashes_.mdwn | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Annex/Init.hs b/Annex/Init.hs index 1193e0b240..96e61eb2d5 100644 --- a/Annex/Init.hs +++ b/Annex/Init.hs @@ -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" ) diff --git a/CHANGELOG b/CHANGELOG index 15b6c1647b..aa7a15a2e1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 Tue, 23 Nov 2021 15:58:27 -0400 diff --git a/doc/bugs/wanted_on_read-only_repo_crashes_.mdwn b/doc/bugs/wanted_on_read-only_repo_crashes_.mdwn index 244b2a1c89..ab59f9e7d0 100644 --- a/doc/bugs/wanted_on_read-only_repo_crashes_.mdwn +++ b/doc/bugs/wanted_on_read-only_repo_crashes_.mdwn @@ -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]] -- 2.39.5