Skip to content

Commit d3b9e9f

Browse files
chriscoolgitster
authored andcommitted
Documentation/git-update-index: explain splitIndex.*
Signed-off-by: Christian Couder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fd44251 commit d3b9e9f

File tree

2 files changed

+32
-11
lines changed

2 files changed

+32
-11
lines changed

Documentation/config.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2792,9 +2792,9 @@ splitIndex.sharedIndexExpire::
27922792
index file is created. The value "now" expires all entries
27932793
immediately, and "never" suppresses expiration altogether.
27942794
The default value is "one.week.ago".
2795-
Note that each time a new split-index file is created, the
2796-
mtime of the related shared index file is updated to the
2797-
current time.
2795+
Note that each time a split index based on a shared index file
2796+
is either created or read from, the mtime of the shared index
2797+
file is updated to the current time.
27982798
See linkgit:git-update-index[1].
27992799

28002800
status.relativePaths::

Documentation/git-update-index.txt

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,10 @@ may not support it yet.
163163

164164
--split-index::
165165
--no-split-index::
166-
Enable or disable split index mode. If enabled, the index is
167-
split into two files, $GIT_DIR/index and $GIT_DIR/sharedindex.<SHA-1>.
168-
Changes are accumulated in $GIT_DIR/index while the shared
169-
index file contains all index entries stays unchanged. If
170-
split-index mode is already enabled and `--split-index` is
171-
given again, all changes in $GIT_DIR/index are pushed back to
172-
the shared index file. This mode is designed for very large
173-
indexes that take a significant amount of time to read or write.
166+
Enable or disable split index mode. If split-index mode is
167+
already enabled and `--split-index` is given again, all
168+
changes in $GIT_DIR/index are pushed back to the shared index
169+
file.
174170
+
175171
These options take effect whatever the value of the `core.splitIndex`
176172
configuration variable (see linkgit:git-config[1]). But a warning is
@@ -394,6 +390,31 @@ Although this bit looks similar to assume-unchanged bit, its goal is
394390
different from assume-unchanged bit's. Skip-worktree also takes
395391
precedence over assume-unchanged bit when both are set.
396392

393+
Split index
394+
-----------
395+
396+
This mode is designed for very large indexes that take a significant
397+
amount of time to read or write.
398+
399+
In this mode, the index is split into two files, $GIT_DIR/index and
400+
$GIT_DIR/sharedindex.<SHA-1>. Changes are accumulated in
401+
$GIT_DIR/index, the split index, while the shared index file contains
402+
all index entries and stays unchanged.
403+
404+
All changes in the split index are pushed back to the shared index
405+
file when the number of entries in the split index reaches a level
406+
specified by the splitIndex.maxPercentChange config variable (see
407+
linkgit:git-config[1]).
408+
409+
Each time a new shared index file is created, the old shared index
410+
files are deleted if their mtime is older than what is specified by
411+
the splitIndex.sharedIndexExpire config variable (see
412+
linkgit:git-config[1]).
413+
414+
To avoid deleting a shared index file that is still used, its mtime is
415+
updated to the current time everytime a new split index based on the
416+
shared index file is either created or read from.
417+
397418
Untracked cache
398419
---------------
399420

0 commit comments

Comments
 (0)