show message when doing possibly expensive from scratch reposize calculation
authorJoey Hess <joeyh@joeyh.name>
Thu, 15 Aug 2024 16:40:48 +0000 (12:40 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 15 Aug 2024 16:42:36 +0000 (12:42 -0400)
Annex/RepoSize.hs
doc/git-annex-preferred-content.mdwn

index 6e823c98b96086146b6f8c9c66893aec161bd612..dac089a96200b9a5046301e2a102a16db60c0d56 100644 (file)
@@ -5,6 +5,8 @@
  - Licensed under the GNU AGPL version 3 or higher.
  -}
 
+{-# LANGUAGE OverloadedStrings #-}
+
 module Annex.RepoSize (
        getRepoSizes,
 ) where
@@ -43,6 +45,7 @@ updateRepoSizes = bracket Db.openDb Db.closeDb $ \h -> do
                                        calculatefromscratch h >>= set
   where
        calculatefromscratch h = do
+               showSideAction "calculating repository sizes"
                (sizemap, branchsha) <- calcBranchRepoSizes
                liftIO $ Db.setRepoSizes h sizemap branchsha
                journalledRepoSizes sizemap branchsha
index 8069cb201f9a11c35195fe7f1508abb653d8acc8..7ef98d14c8b45bbbea94698679a08edb7452d476 100644 (file)
@@ -294,6 +294,14 @@ elsewhere to allow removing it).
   expression, which will make repositories want to move files around as
   necessary in order to get fully balanced.
 
+  Using this in a perferred content expression makes git-annex need to do
+  some additional work to keep track of how full repositories are. Usually
+  that won't affect performance much. However, the first time git-annex
+  processes this in a given git repository, it will need to examine
+  all the locations of all files, which can be slow when there are a lot of
+  them. When this causes git-annex to do a lot of work, it will
+  display "(calculating repository sizes)".
+
   Note that `not balanced` is a bad thing to put in a preferred content
   expression for the same reason `not present` is.