From f94908f2a6bdd77df95ae973bcfee258276744e8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 5 Aug 2022 12:29:33 -0400 Subject: [PATCH] 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 --- CHANGELOG | 1 + Remote/Bup.hs | 17 +++++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 05989b1804..45991265a9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 Mon, 25 Jul 2022 15:35:45 -0400 diff --git a/Remote/Bup.hs b/Remote/Bup.hs index f2ee22592b..35e95e6bbe 100644 --- a/Remote/Bup.hs +++ b/Remote/Bup.hs @@ -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 -- 2.30.2