make git-annex:git-annex push quiet again
Recent changes had a side effect of displaying errors in the fairly common case when this push fails. Since the synced/git-annex push is always forced, those errors are noise, so hide again. This means 3 separate pushes are done now, where before it only made 2. A bit more expensive, but ssh connection caching eliminates most of the costs. This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.
This commit is contained in:
parent
de4d50e9d0
commit
4594bece40
1 changed files with 4 additions and 4 deletions
|
@ -418,12 +418,14 @@ pushRemote o remote (Just branch, _) = stopUnless (pure (pushOption o) <&&> need
|
||||||
- set on the remote.
|
- set on the remote.
|
||||||
-}
|
-}
|
||||||
pushBranch :: Remote -> Git.Branch -> Git.Repo -> IO Bool
|
pushBranch :: Remote -> Git.Branch -> Git.Repo -> IO Bool
|
||||||
pushBranch remote branch g = directpush `after` syncpush
|
pushBranch remote branch g = directpush `after` annexpush `after` syncpush
|
||||||
where
|
where
|
||||||
syncpush = flip Git.Command.runBool g $ pushparams
|
syncpush = flip Git.Command.runBool g $ pushparams
|
||||||
[ Git.Branch.forcePush $ refspec Annex.Branch.name
|
[ Git.Branch.forcePush $ refspec Annex.Branch.name
|
||||||
, refspec $ fromAdjustedBranch branch
|
, refspec $ fromAdjustedBranch branch
|
||||||
]
|
]
|
||||||
|
annexpush = void $ tryIO $ flip Git.Command.runQuiet g $ pushparams
|
||||||
|
[ Git.fromRef $ Git.Ref.base $ Annex.Branch.name ]
|
||||||
directpush = do
|
directpush = do
|
||||||
-- Git prints out an error message when this fails.
|
-- Git prints out an error message when this fails.
|
||||||
-- In the default configuration of receive.denyCurrentBranch,
|
-- In the default configuration of receive.denyCurrentBranch,
|
||||||
|
@ -436,9 +438,7 @@ pushBranch remote branch g = directpush `after` syncpush
|
||||||
-- receive.denyCurrentBranch=updateInstead -- the user
|
-- receive.denyCurrentBranch=updateInstead -- the user
|
||||||
-- will want to see that one.
|
-- will want to see that one.
|
||||||
let p = flip Git.Command.gitCreateProcess g $ pushparams
|
let p = flip Git.Command.gitCreateProcess g $ pushparams
|
||||||
[ Git.fromRef $ Git.Ref.base $ Annex.Branch.name
|
[ Git.fromRef $ Git.Ref.base $ fromDirectBranch $ fromAdjustedBranch branch ]
|
||||||
, Git.fromRef $ Git.Ref.base $ fromDirectBranch $ fromAdjustedBranch branch
|
|
||||||
]
|
|
||||||
(transcript, ok) <- processTranscript' p Nothing
|
(transcript, ok) <- processTranscript' p Nothing
|
||||||
when (not ok && not ("denyCurrentBranch" `isInfixOf` transcript)) $
|
when (not ok && not ("denyCurrentBranch" `isInfixOf` transcript)) $
|
||||||
hPutStr stderr transcript
|
hPutStr stderr transcript
|
||||||
|
|
Loading…
Add table
Reference in a new issue