From cee14f147ac229c99f001b3a0aaaefb4cb6f7785 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 15 Nov 2019 12:01:30 -0400 Subject: [PATCH] stop displaying rsync progress, and use git-annex's own progress display for local-to-local repo transfers Reasons to do this include: 1. I've gotten pretty used to git-annex's own progress display, which is used for all transfers over ssh (except to old git-annex-shell), and for most special remote transfers. It's getting to seem weird to see the rsync progress display instead. 2. When -J was used, the rsync output could not be shown, and so there was no progress display. Now there will be. Progress will also be displayed now when cp CoW is used. But I'd expect a CoW copy to typically run so fast that the progress display will barely be noticable. This commit was sponsored by Peter on Patreon. --- CHANGELOG | 7 +++++++ Remote/Git.hs | 19 ++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1bd911abfa..182448d54b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +git-annex (7.20191115) UNRELEASED; urgency=medium + + * Stop displaying rsync progress, and use git-annex's own progress display + for local-to-local repo transfers. + + -- Joey Hess Fri, 15 Nov 2019 11:57:19 -0400 + git-annex (7.20191114) upstream; urgency=medium * Added annex.allowsign option. diff --git a/Remote/Git.hs b/Remote/Git.hs index e40a2991b8..059a1673d2 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -497,8 +497,9 @@ copyFromRemote'' repo forcersync r st@(State connpool _ _ _) key file dest meter Just (object, checksuccess) -> do copier <- mkCopier hardlink st params runTransfer (Transfer Download u key) - file stdRetry - (\p -> copier object dest (combineMeterUpdate p meterupdate) checksuccess) + file stdRetry $ \p -> + metered (Just (combineMeterUpdate p meterupdate)) key $ \_ p' -> + copier object dest p' checksuccess | Git.repoIsSsh repo = if forcersync then fallback meterupdate else P2PHelper.retrieve @@ -631,15 +632,15 @@ copyToRemote' repo r st@(State connpool duc _ _) key file meterupdate -- run copy from perspective of remote onLocalFast repo r $ ifM (Annex.Content.inAnnex key) ( return True - , do + , runTransfer (Transfer Download u key) file stdRetry $ \p -> do copier <- mkCopier hardlink st params let verify = Annex.Content.RemoteVerify r let rsp = RetrievalAllKeysSecure - runTransfer (Transfer Download u key) file stdRetry $ \p -> - let p' = combineMeterUpdate meterupdate p - in Annex.Content.saveState True `after` - Annex.Content.getViaTmp rsp verify key - (\dest -> copier object dest p' (liftIO checksuccessio)) + res <- Annex.Content.getViaTmp rsp verify key $ \dest -> + metered (Just (combineMeterUpdate meterupdate p)) key $ \_ p' -> + copier object dest p' (liftIO checksuccessio) + Annex.Content.saveState True + return res ) copyremotefallback p = Annex.Content.sendAnnex key noop $ \object -> do -- This is too broad really, but recvkey normally @@ -749,7 +750,7 @@ rsyncOrCopyFile st rsyncparams src dest p = dorsync = do -- dest may already exist, so make sure rsync can write to it void $ liftIO $ tryIO $ allowWrite dest - oh <- mkOutputHandler + oh <- mkOutputHandlerQuiet Ssh.rsyncHelper oh (Just p) $ rsyncparams ++ [File src, File dest] docopycow = docopywith copyCoW -- 2.30.2