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. -}

15
debian/changelog vendored
View file

@ -6,12 +6,6 @@ git-annex (3.20120124) UNRELEASED; urgency=low
* S3: Fix irrefutable pattern failure when accessing encrypted S3
credentials.
* Use the haskell IfElse library.
* Avoid repeated location log commits when a remote is receiving files.
Done by adding a oneshot mode, in which location log changes are
written to the journal, but not committed. Taking advantage of
git-annex's existing ability to recover in this situation. This is
used by git-annex-shell and other places where changes are made to
a remote's location log.
* Fix teardown of stale cached ssh connections.
* Fixed to use the strict state monad, to avoid leaking all kinds of memory
due to lazy state update thunks when adding/fixing many files.
@ -35,6 +29,15 @@ git-annex (3.20120124) UNRELEASED; urgency=low
* Store web special remote url info in a more efficient location.
* Deal with NFS problem that caused a failure to remove a directory
when removing content from the annex.
* Avoid repeated location log commits when a remote is receiving files.
Done by adding a oneshot mode, in which location log changes are
written to the journal, but not committed. Taking advantage of
git-annex's existing ability to recover in this situation. This is
used by git-annex-shell and other places where changes are made to
a remote's location log.
* 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.
-- Joey Hess <joeyh@debian.org> Tue, 24 Jan 2012 16:21:55 -0400

View file

@ -606,6 +606,13 @@ Here are all the supported configuration settings.
By default, git-annex caches ssh connections. To disable this, set to `false`.
* `annex.alwayscommit`
By default, git-annex automatically commits data to the git-annex branch
after each command is run. To disable these commits,
set to `false`. Then data will only be committed when
running `git annex merge` (or by automatic merges) or `git annex sync`.
* `remote.<name>.annex-cost`
When determining which repository to