Skip to content

Commit 9d21e3f

Browse files
committed
core.fsync: add a derived-metadata aggregate option
This commit adds an aggregate option that currently includes the commit-graph file and pack metadata (indexes and bitmaps). The user may want to exclude this set from durability since they can be recomputed from other data if they wind up corrupt or missing. This is split out from the other patches in the series since it is an optional nice-to-have that might be controversial. Signed-off-by: Neeraj Singh <neerajsi@microsoft.com>
1 parent b8a0246 commit 9d21e3f

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Documentation/config/core.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,9 @@ core.fsync::
562562
* `pack-metadata` hardens packfile bitmaps and indexes.
563563
* `commit-graph` hardens the commit graph file.
564564
* `index` hardens the index when it is modified.
565-
* `objects` is an aggregate option that includes `loose-objects`, `pack`,
566-
`pack-metadata`, and `commit-graph`.
567-
* `default` is an aggregate option that is equivalent to `objects,-loose-object`
565+
* `objects` is an aggregate option that includes `loose-objects` and `pack`.
566+
* `derived-metadata` is an aggregate option that includes `pack-metadata` and `commit-graph`.
567+
* `default` is an aggregate option that is equivalent to `objects,derived-metadata,-loose-object`
568568
* `all` is an aggregate option that syncs all individual components above.
569569

570570
core.fsyncMethod::

cache.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,9 +1012,10 @@ enum fsync_component {
10121012
FSYNC_COMPONENT_COMMIT_GRAPH)
10131013

10141014
#define FSYNC_COMPONENTS_OBJECTS (FSYNC_COMPONENT_LOOSE_OBJECT | \
1015-
FSYNC_COMPONENT_PACK | \
1016-
FSYNC_COMPONENT_PACK_METADATA | \
1017-
FSYNC_COMPONENT_COMMIT_GRAPH)
1015+
FSYNC_COMPONENT_PACK)
1016+
1017+
#define FSYNC_COMPONENTS_DERIVED_METADATA (FSYNC_COMPONENT_PACK_METADATA | \
1018+
FSYNC_COMPONENT_COMMIT_GRAPH)
10181019

10191020
#define FSYNC_COMPONENTS_ALL (FSYNC_COMPONENT_LOOSE_OBJECT | \
10201021
FSYNC_COMPONENT_PACK | \

config.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,7 @@ static const struct fsync_component_entry {
12231223
{ "commit-graph", FSYNC_COMPONENT_COMMIT_GRAPH },
12241224
{ "index", FSYNC_COMPONENT_INDEX },
12251225
{ "objects", FSYNC_COMPONENTS_OBJECTS },
1226+
{ "derived-metadata", FSYNC_COMPONENTS_DERIVED_METADATA },
12261227
{ "default", FSYNC_COMPONENTS_DEFAULT },
12271228
{ "all", FSYNC_COMPONENTS_ALL },
12281229
};

0 commit comments

Comments
 (0)