summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorNeeraj Singh <neerajsi@microsoft.com>2022-03-15 19:12:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-03-15 19:32:55 (GMT)
commitb9f5d0358d2e882d47f496c1a5589f6cebc25578 (patch)
tree53f763c3f56323114359d1682322b6a4cea0906d /cache.h
parentba95e96d4c6eed42e30ac3c8b260f4459e3a8575 (diff)
downloadgit-b9f5d0358d2e882d47f496c1a5589f6cebc25578.zip
git-b9f5d0358d2e882d47f496c1a5589f6cebc25578.tar.gz
git-b9f5d0358d2e882d47f496c1a5589f6cebc25578.tar.bz2
core.fsync: documentation and user-friendly aggregate options
This commit adds aggregate options for the core.fsync setting that are more user-friendly. These options are specified in terms of 'levels of safety', indicating which Git operations are considered to be sync points for durability. The new documentation is also included here in its entirety for ease of review. Signed-off-by: Neeraj Singh <neerajsi@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/cache.h b/cache.h
index e08eeac..86680f1 100644
--- a/cache.h
+++ b/cache.h
@@ -1007,9 +1007,26 @@ enum fsync_component {
FSYNC_COMPONENT_INDEX = 1 << 4,
};
-#define FSYNC_COMPONENTS_DEFAULT (FSYNC_COMPONENT_PACK | \
- FSYNC_COMPONENT_PACK_METADATA | \
- FSYNC_COMPONENT_COMMIT_GRAPH)
+#define FSYNC_COMPONENTS_OBJECTS (FSYNC_COMPONENT_LOOSE_OBJECT | \
+ FSYNC_COMPONENT_PACK)
+
+#define FSYNC_COMPONENTS_DERIVED_METADATA (FSYNC_COMPONENT_PACK_METADATA | \
+ FSYNC_COMPONENT_COMMIT_GRAPH)
+
+#define FSYNC_COMPONENTS_DEFAULT (FSYNC_COMPONENTS_OBJECTS | \
+ FSYNC_COMPONENTS_DERIVED_METADATA | \
+ ~FSYNC_COMPONENT_LOOSE_OBJECT)
+
+#define FSYNC_COMPONENTS_COMMITTED (FSYNC_COMPONENTS_OBJECTS)
+
+#define FSYNC_COMPONENTS_ADDED (FSYNC_COMPONENTS_COMMITTED | \
+ FSYNC_COMPONENT_INDEX)
+
+#define FSYNC_COMPONENTS_ALL (FSYNC_COMPONENT_LOOSE_OBJECT | \
+ FSYNC_COMPONENT_PACK | \
+ FSYNC_COMPONENT_PACK_METADATA | \
+ FSYNC_COMPONENT_COMMIT_GRAPH | \
+ FSYNC_COMPONENT_INDEX)
/*
* A bitmask indicating which components of the repo should be fsynced.