diff options
-rw-r--r-- | Assistant/Threads/SanityChecker.hs | 3 | ||||
-rw-r--r-- | Git/Command.hs | 11 | ||||
-rw-r--r-- | debian/changelog | 1 |
3 files changed, 11 insertions, 4 deletions
diff --git a/Assistant/Threads/SanityChecker.hs b/Assistant/Threads/SanityChecker.hs index 8aa691cdc..a1be8dffc 100644 --- a/Assistant/Threads/SanityChecker.hs +++ b/Assistant/Threads/SanityChecker.hs @@ -122,6 +122,7 @@ waitForNextCheck = do dailyCheck :: Assistant Bool dailyCheck = do g <- liftAnnex gitRepo + batchmaker <- liftIO getBatchCommandMaker -- Find old unstaged symlinks, and add them to git. (unstaged, cleanup) <- liftIO $ Git.LsFiles.notInRepo False ["."] g @@ -140,7 +141,7 @@ dailyCheck = do - 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 + liftIO $ void $ Git.Command.runBatch batchmaker [ Param "-c", Param "gc.auto=670000" , Param "gc" , Param "--auto" diff --git a/Git/Command.hs b/Git/Command.hs index 4c338ba25..90abc7e4f 100644 --- a/Git/Command.hs +++ b/Git/Command.hs @@ -18,6 +18,7 @@ import qualified Utility.CoProcess as CoProcess #ifdef mingw32_HOST_OS import Git.FilePath #endif +import Utility.Batch {- Constructs a git command line operating on the specified repo. -} gitCommandLine :: [CommandParam] -> Repo -> [CommandParam] @@ -41,9 +42,13 @@ gitCommandLine _ repo = assertLocal repo $ error "internal" {- Runs git in the specified repo. -} runBool :: [CommandParam] -> Repo -> IO Bool runBool params repo = assertLocal repo $ - boolSystemEnv "git" - (gitCommandLine params repo) - (gitEnv repo) + boolSystemEnv "git" (gitCommandLine params repo) (gitEnv repo) + +{- Runs git in batch mode. -} +runBatch :: BatchCommandMaker -> [CommandParam] -> Repo -> IO Bool +runBatch batchmaker params repo = assertLocal repo $ do + let (cmd, params') = batchmaker ("git", gitCommandLine params repo) + boolSystemEnv cmd params' (gitEnv repo) {- Runs git in the specified repo, throwing an error if it fails. -} run :: [CommandParam] -> Repo -> IO () diff --git a/debian/changelog b/debian/changelog index 7c2a0d3b3..900d84984 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,7 @@ git-annex (5.20140118) UNRELEASED; urgency=medium * Client, transfer, incremental backup, and archive repositories now want to get content that does not yet have enough copies. * repair: Check git version at run time. + * assistant: Run the periodic git gc in batch mode. -- Joey Hess <joeyh@debian.org> Sat, 18 Jan 2014 11:54:17 -0400 |