summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Command/Fsck.hs6
-rw-r--r--Messages.hs4
-rw-r--r--debian/changelog3
-rw-r--r--doc/bugs/Files_in___34__here__34___not_known_to_git_annex.mdwn2
-rw-r--r--doc/bugs/Files_in___34__here__34___not_known_to_git_annex/comment_3_3b94625acd0fda06545243d9c163cfba._comment16
5 files changed, 30 insertions, 1 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index 5561f9160..5a11ce192 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -90,6 +90,7 @@ seek :: FsckOptions -> CommandSeek
seek o = allowConcurrentOutput $ do
from <- maybe (pure Nothing) (Just <$$> getParsed) (fsckFromOption o)
u <- maybe getUUID (pure . Remote.uuid) from
+ checkDeadRepo u
i <- prepIncremental u (incrementalOpt o)
withKeyOptions (keyOptions o) False
(\k -> startKey i k =<< getNumCopies)
@@ -98,6 +99,11 @@ seek o = allowConcurrentOutput $ do
cleanupIncremental i
void $ tryIO $ recordActivity Fsck u
+checkDeadRepo :: UUID -> Annex ()
+checkDeadRepo u =
+ whenM ((==) DeadTrusted <$> lookupTrust u) $
+ earlyWarning "Warning: Fscking a repository that is currently marked as dead."
+
start :: Maybe Remote -> Incremental -> FilePath -> Key -> CommandStart
start from inc file key = do
v <- Backend.getBackend file key
diff --git a/Messages.hs b/Messages.hs
index 650e6162a..a49f20711 100644
--- a/Messages.hs
+++ b/Messages.hs
@@ -22,6 +22,7 @@ module Messages (
endResult,
toplevelWarning,
warning,
+ earlyWarning,
warningIO,
indent,
maybeShowJSON,
@@ -124,6 +125,9 @@ toplevelWarning makeway s = warning' makeway ("git-annex: " ++ s)
warning :: String -> Annex ()
warning = warning' True . indent
+earlyWarning :: String -> Annex ()
+earlyWarning = warning' False
+
warning' :: Bool -> String -> Annex ()
warning' makeway w = do
when makeway $
diff --git a/debian/changelog b/debian/changelog
index ae3b85218..fd0dad986 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,7 +23,8 @@ git-annex (5.20151102.2) UNRELEASED; urgency=medium
* Make git-annex-standalone.deb include the git-annex html documentation,
desktop file, and base completion file, same as the regular git-annex.deb.
* fsck: When fscking a dead repo, avoid incorrect "fixing location log"
- message.
+ message, and display a message, since it's unusual to have access to a
+ dead repo.
-- Joey Hess <id@joeyh.name> Wed, 04 Nov 2015 12:50:20 -0400
diff --git a/doc/bugs/Files_in___34__here__34___not_known_to_git_annex.mdwn b/doc/bugs/Files_in___34__here__34___not_known_to_git_annex.mdwn
index 8a389025f..6fd47cc5a 100644
--- a/doc/bugs/Files_in___34__here__34___not_known_to_git_annex.mdwn
+++ b/doc/bugs/Files_in___34__here__34___not_known_to_git_annex.mdwn
@@ -48,3 +48,5 @@ File system is ext4.
### What version of git-annex are you using? On what operating system?
git-annex version: 5.20151019-1, Debian unstable.
+
+> improved fsck output [[done]] --[[Joey]]
diff --git a/doc/bugs/Files_in___34__here__34___not_known_to_git_annex/comment_3_3b94625acd0fda06545243d9c163cfba._comment b/doc/bugs/Files_in___34__here__34___not_known_to_git_annex/comment_3_3b94625acd0fda06545243d9c163cfba._comment
new file mode 100644
index 000000000..b08ecd052
--- /dev/null
+++ b/doc/bugs/Files_in___34__here__34___not_known_to_git_annex/comment_3_3b94625acd0fda06545243d9c163cfba._comment
@@ -0,0 +1,16 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 3"""
+ date="2015-11-10T18:06:36Z"
+ content="""
+Aha, there is a bug indeed; fscking a dead repository always claims to
+be "fixing location log", but the location log is fine and doesn't need
+fixing. Fixed that.
+
+As to discovering when you're in a dead repository, there are a lot of
+things that could be done, but most of them seem to add special cases
+that are complicating both to implement and for parsing the resulting
+output (like putting "(dead)" next to the description/name of a
+dead repository). Seems reasonable to have fsck note when the repository
+it's checking is dead, and leave it at that.
+"""]]