--explain for preferred/required content matching
And annex.largefiles and annex.addunlocked. Also git-annex matchexpression --explain explains why its input expression matches or fails to match. When there is no limit, avoid explaining why the lack of limit matches. This is also done when no preferred content expression is set, although in a few cases it defaults to a non-empty matcher, which will be explained. Sponsored-by: Dartmouth College's DANDI project
This commit is contained in:
parent
ba1c222912
commit
518a51a8a0
12 changed files with 89 additions and 60 deletions
11
Messages.hs
11
Messages.hs
|
@ -300,13 +300,14 @@ jsonOutputEnabled = withMessageState $ \s -> return $
|
|||
JSONOutput _ -> True
|
||||
_ -> False
|
||||
|
||||
explain :: Maybe RawFilePath -> StringContainingQuotedPath -> Annex ()
|
||||
explain Nothing _ = return ()
|
||||
explain (Just f) msg = do
|
||||
explain :: ActionItem -> Maybe StringContainingQuotedPath -> Annex ()
|
||||
explain ai (Just msg) = do
|
||||
rd <- Annex.getRead id
|
||||
when (Annex.explainenabled rd) $
|
||||
outputMessage JSON.none id $
|
||||
"[" <> QuotedPath f <> " " <> msg <> "]\n"
|
||||
let d = actionItemDesc ai
|
||||
in outputMessage JSON.none id $
|
||||
"[" <> (if d == mempty then "" else (d <> " ")) <> msg <> "]\n"
|
||||
explain _ _ = return ()
|
||||
|
||||
{- Prevents any concurrent console access while running an action, so
|
||||
- that the action is the only thing using the console, and can eg prompt
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue