improve output when storing to bup
bup split outputs to stderr even with -q. This was discarded when using -J, but it was still outputting when not using -J, and so was git-annex. Sponsored-by: Nicholas Golder-Manning on Patreon
This commit is contained in:
parent
a23fd7349f
commit
f94908f2a6
2 changed files with 8 additions and 10 deletions
|
@ -13,6 +13,7 @@ git-annex (10.20220725) UNRELEASED; urgency=medium
|
|||
* add --dry-run: New option.
|
||||
* Work around bug in git 2.37 that causes a segfault
|
||||
when when core.untrackedCache is set, and broke git-annex init.
|
||||
* Improve output when storing to bup.
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Mon, 25 Jul 2022 15:35:45 -0400
|
||||
|
||||
|
|
|
@ -155,22 +155,19 @@ bupSplitParams r buprepo k src =
|
|||
|
||||
store :: Remote -> BupRepo -> Storer
|
||||
store r buprepo = byteStorer $ \k b p -> do
|
||||
showOutput -- make way for bup output
|
||||
quiet <- commandProgressDisabled
|
||||
liftIO $ withNullHandle $ \nullh ->
|
||||
let params = bupSplitParams r buprepo k []
|
||||
cmd = (proc "bup" (toCommand params))
|
||||
{ std_in = CreatePipe }
|
||||
cmd' = if quiet
|
||||
then cmd
|
||||
{ std_out = UseHandle nullh
|
||||
, std_err = UseHandle nullh
|
||||
}
|
||||
else cmd
|
||||
{ std_in = CreatePipe
|
||||
, std_out = UseHandle nullh
|
||||
-- bup split is noisy to stderr even with the -q
|
||||
-- option.
|
||||
, std_err = UseHandle nullh
|
||||
}
|
||||
feeder = \h -> do
|
||||
meteredWrite p (S.hPut h) b
|
||||
hClose h
|
||||
in withCreateProcess cmd' (go feeder cmd')
|
||||
in withCreateProcess cmd (go feeder cmd)
|
||||
where
|
||||
go feeder p (Just h) _ _ pid =
|
||||
forceSuccessProcess p pid
|
||||
|
|
Loading…
Reference in a new issue