add annex.alwayscommit option

To avoid commits of data to the git-annex branch after each command
is run, set annex.alwayscommit=false. Its data will then be committed
less frequently, when a merge or sync is done.
This commit is contained in:
Joey Hess 2012-02-25 15:23:17 -04:00
parent 638741f49e
commit b49c0c2633
3 changed files with 19 additions and 7 deletions

View file

@ -32,6 +32,7 @@ import Common.Annex
import Logs.Location
import Annex.UUID
import qualified Git
import qualified Git.Config
import qualified Annex
import qualified Annex.Queue
import qualified Annex.Branch
@ -311,7 +312,8 @@ getKeysPresent' dir = do
saveState :: Bool -> Annex ()
saveState oneshot = do
Annex.Queue.flush False
unless oneshot $
alwayscommit <- Git.configTrue <$> fromRepo (Git.Config.get "annex.alwayscommit" "true")
unless (oneshot || not alwayscommit) $ do
Annex.Branch.commit "update"
{- Downloads content from any of a list of urls. -}