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)
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
endResult,
toplevelWarning,
warning,
+ earlyWarning,
warningIO,
indent,
maybeShowJSON,
warning :: String -> Annex ()
warning = warning' True . indent
+earlyWarning :: String -> Annex ()
+earlyWarning = warning' False
+
warning' :: Bool -> String -> Annex ()
warning' makeway w = do
when makeway $
* 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
### 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]]
--- /dev/null
+[[!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.
+"""]]