diff options
-rw-r--r-- | Assistant/Threads/Committer.hs | 3 | ||||
-rw-r--r-- | Assistant/Threads/SanityChecker.hs | 13 | ||||
-rw-r--r-- | debian/changelog | 7 |
3 files changed, 16 insertions, 7 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs index 75976ee3c..99d01b580 100644 --- a/Assistant/Threads/Committer.hs +++ b/Assistant/Threads/Committer.hs @@ -82,8 +82,7 @@ commitStaged = do Right _ -> do direct <- isDirect let params = nomessage $ catMaybes - [ Just $ Param "-c", Just $ Param "gc.auto=0" - , Just $ Param "commit" + [ Just $ Param "commit" , Just $ Param "--quiet" {- In indirect mode, avoid running the - usual git-annex pre-commit hook; diff --git a/Assistant/Threads/SanityChecker.hs b/Assistant/Threads/SanityChecker.hs index 806441058..906167ca8 100644 --- a/Assistant/Threads/SanityChecker.hs +++ b/Assistant/Threads/SanityChecker.hs @@ -15,6 +15,7 @@ import Assistant.DaemonStatus import Assistant.Alert import qualified Git.LsFiles import qualified Git.Command +import qualified Git.Config import Utility.ThreadScheduler import qualified Assistant.Threads.Watcher as Watcher import Utility.LogFile @@ -85,8 +86,16 @@ dailyCheck = do liftIO $ void cleanup {- Allow git-gc to run once per day. More frequent gc is avoided - - to avoid slowing things down. -} - void $ liftIO $ Git.Command.runBool [Param "gc", Param "--auto"] g + - by default to avoid slowing things down. Only run repacks when 100x + - the usual number of loose objects are present; we tend + - to have a lot of small objects and they should not be a + - significant size. -} + when (Git.Config.getMaybe "gc.auto" g == Just "0") $ + liftIO $ void $ Git.Command.runBool + [ Param "-c", Param "gc.auto=670000" + , Param "gc" + , Param "--auto" + ] g return True where diff --git a/debian/changelog b/debian/changelog index a9a0fc10a..dab3e7b5b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,9 +9,10 @@ git-annex (4.20130228) UNRELEASED; urgency=low files in direct mode repositories. * assistant: Fix dropping content when a file is moved to an archive directory. - * assistant: Prevent automatic commits from causing git-gc runs, - as that can make things quite slow. Instead, git-gc --auto is run - once a day. (This can be disabled by the usual gc.auto=0 setting.) + * assistant: Set gc.auto=0 when creating repositories to prevent + automatic commits from causing git-gc runs. + * assistant: If gc.auto=0, run git-gc once a day, packing loose objects + very non-aggressively. -- Joey Hess <joeyh@debian.org> Wed, 27 Feb 2013 23:20:40 -0400 |