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.
|
* add --dry-run: New option.
|
||||||
* Work around bug in git 2.37 that causes a segfault
|
* Work around bug in git 2.37 that causes a segfault
|
||||||
when when core.untrackedCache is set, and broke git-annex init.
|
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
|
-- 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 :: Remote -> BupRepo -> Storer
|
||||||
store r buprepo = byteStorer $ \k b p -> do
|
store r buprepo = byteStorer $ \k b p -> do
|
||||||
showOutput -- make way for bup output
|
|
||||||
quiet <- commandProgressDisabled
|
|
||||||
liftIO $ withNullHandle $ \nullh ->
|
liftIO $ withNullHandle $ \nullh ->
|
||||||
let params = bupSplitParams r buprepo k []
|
let params = bupSplitParams r buprepo k []
|
||||||
cmd = (proc "bup" (toCommand params))
|
cmd = (proc "bup" (toCommand params))
|
||||||
{ std_in = CreatePipe }
|
{ std_in = CreatePipe
|
||||||
cmd' = if quiet
|
, std_out = UseHandle nullh
|
||||||
then cmd
|
-- bup split is noisy to stderr even with the -q
|
||||||
{ std_out = UseHandle nullh
|
-- option.
|
||||||
, std_err = UseHandle nullh
|
, std_err = UseHandle nullh
|
||||||
}
|
}
|
||||||
else cmd
|
|
||||||
feeder = \h -> do
|
feeder = \h -> do
|
||||||
meteredWrite p (S.hPut h) b
|
meteredWrite p (S.hPut h) b
|
||||||
hClose h
|
hClose h
|
||||||
in withCreateProcess cmd' (go feeder cmd')
|
in withCreateProcess cmd (go feeder cmd)
|
||||||
where
|
where
|
||||||
go feeder p (Just h) _ _ pid =
|
go feeder p (Just h) _ _ pid =
|
||||||
forceSuccessProcess p pid
|
forceSuccessProcess p pid
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue