display "Recording state in git..." when staging the journal

A bit tricky to avoid printing it twice in a row when there are queued git
commands to run and journal to stage.

Added a generic way to run an action that may output multiple side
messages, with only the first displayed.
This commit is contained in:
Joey Hess 2012-04-27 13:23:52 -04:00
parent e0b7012ccc
commit 76102c1c75
8 changed files with 72 additions and 27 deletions

View file

@ -20,6 +20,7 @@ import System.Log.Logger
import Common.Annex
import qualified Annex
import Types.Messages
import Limit
import Usage
@ -31,11 +32,11 @@ common =
"avoid slow operations"
, Option ['a'] ["auto"] (NoArg (setauto True))
"automatic mode"
, Option ['q'] ["quiet"] (NoArg (setoutput Annex.QuietOutput))
, Option ['q'] ["quiet"] (NoArg (setoutput QuietOutput))
"avoid verbose output"
, Option ['v'] ["verbose"] (NoArg (setoutput Annex.NormalOutput))
, Option ['v'] ["verbose"] (NoArg (setoutput NormalOutput))
"allow verbose output (default)"
, Option ['j'] ["json"] (NoArg (setoutput Annex.JSONOutput))
, Option ['j'] ["json"] (NoArg (setoutput JSONOutput))
"enable JSON output"
, Option ['d'] ["debug"] (NoArg setdebug)
"show debug messages"
@ -46,7 +47,8 @@ common =
setforce v = Annex.changeState $ \s -> s { Annex.force = v }
setfast v = Annex.changeState $ \s -> s { Annex.fast = v }
setauto v = Annex.changeState $ \s -> s { Annex.auto = v }
setoutput v = Annex.changeState $ \s -> s { Annex.output = v }
setoutput v = Annex.changeState $ \s ->
s { Annex.output = (Annex.output s) { outputType = v } }
setforcebackend v = Annex.changeState $ \s -> s { Annex.forcebackend = Just v }
setdebug = liftIO $ updateGlobalLogger rootLoggerName $
setLevel DEBUG