info: Added --dead-repositories option
I considered a more wide-ranging config option to make other commands also show dead repositories. But it would be difficult to implement that because Remote.keyLocations is used to get locations, filtering out dead repos, and commands like get then try to use those locations. So a config setting would make dead repos sometimes be acted on by commands. Sponsored-by: unqueued on Patreon
This commit is contained in:
parent
27a9915a67
commit
3efad7f5f4
5 changed files with 23 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
|||
git-annex (10.20230803) UNRELEASED; urgency=medium
|
||||
|
||||
* Fix behavior of onlyingroup.
|
||||
* info: Added --dead-repositories option.
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Mon, 07 Aug 2023 13:04:13 -0400
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{- git-annex command
|
||||
-
|
||||
- Copyright 2011-2022 Joey Hess <id@joeyh.name>
|
||||
- Copyright 2011-2023 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
@ -109,6 +109,7 @@ data InfoOptions = InfoOptions
|
|||
, bytesOption :: Bool
|
||||
, batchOption :: BatchMode
|
||||
, autoenableOption :: Bool
|
||||
, deadrepositoriesOption :: Bool
|
||||
}
|
||||
|
||||
optParser :: CmdParamsDesc -> Parser InfoOptions
|
||||
|
@ -123,6 +124,10 @@ optParser desc = InfoOptions
|
|||
( long "autoenable"
|
||||
<> help "list special remotes that are configured to autoenable"
|
||||
)
|
||||
<*> switch
|
||||
( long "dead-repositories"
|
||||
<> help "list repositories that have been marked as dead"
|
||||
)
|
||||
|
||||
seek :: InfoOptions -> CommandSeek
|
||||
seek o = case batchOption o of
|
||||
|
@ -134,6 +139,8 @@ start :: InfoOptions -> [String] -> CommandStart
|
|||
start o [] = do
|
||||
if autoenableOption o
|
||||
then autoenableInfo
|
||||
else if deadrepositoriesOption o
|
||||
then deadrepositoriesInfo o
|
||||
else globalInfo o
|
||||
stop
|
||||
start o ps = do
|
||||
|
@ -163,6 +170,11 @@ autoenableInfo = showCustom "info" (SeekInput []) $ do
|
|||
showRaw (encodeBS s)
|
||||
return True
|
||||
|
||||
deadrepositoriesInfo :: InfoOptions -> Annex ()
|
||||
deadrepositoriesInfo o = showCustom "info" (SeekInput []) $ do
|
||||
evalStateT (showStat (repo_list DeadTrusted)) (emptyStatInfo o)
|
||||
return True
|
||||
|
||||
itemInfo :: InfoOptions -> (SeekInput, String) -> Annex ()
|
||||
itemInfo o (si, p) = ifM (isdir (toRawFilePath p))
|
||||
( dirInfo o p si
|
||||
|
|
|
@ -12,7 +12,7 @@ This command exists to deal with situations where data has been lost,
|
|||
and you know it has, and you want to stop being reminded of that fact.
|
||||
|
||||
When a repository is specified, indicates that the repository has
|
||||
been irretrievably lost, so it will not be listed in eg, `git annex info`.
|
||||
been irretrievably lost, so it will not be listed in eg, `git annex whereis`.
|
||||
Repositories can be specified using their remote name, their
|
||||
description, or their UUID. (To undo, use `git-annex semitrust`.)
|
||||
|
||||
|
|
|
@ -50,6 +50,11 @@ for the local repository and all annexed content.
|
|||
Display a list of special remotes that have been configured to
|
||||
autoenable.
|
||||
|
||||
* `--dead-repositories`
|
||||
|
||||
Display a list of repositories that have been marked as dead.
|
||||
Such repositories are not displayed in other info displays.
|
||||
|
||||
* matching options
|
||||
|
||||
The [[git-annex-matching-options]](1) can be used to select what
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
Would it be possible for `git annex info` to also show dead remotes (behind an option is fine), to make it easy to find what dead remotes there are? I needed to check what I had done for a service that was going away (AARNET Cloudstor, which used webdav), and was confused as to why it wasn't appearing anywhere.
|
||||
|
||||
> Implemented `git-annex info --dead-repositories` [[done]] --[[Joey]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue