summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-02-25 15:23:17 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-02-25 15:31:42 -0400
commitb49c0c2633d662a7c91a609aec74f95f189129ad (patch)
tree6a09c0b8689a6d9d5945cd0e97ee251088f2f20e
parent638741f49e1c4a52b09e6dbf83f1dfbfcbd466d4 (diff)
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.
-rw-r--r--Annex/Content.hs4
-rw-r--r--debian/changelog15
-rw-r--r--doc/git-annex.mdwn7
3 files changed, 19 insertions, 7 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs
index fc5f46af9..3a388129e 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -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. -}
diff --git a/debian/changelog b/debian/changelog
index 8c30c2500..44cdb3782 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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
diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn
index bd9139173..0dc22b88d 100644
--- a/doc/git-annex.mdwn
+++ b/doc/git-annex.mdwn
@@ -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