Skip to content

Commit b460139

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 b2dd1c5 commit b460139

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

Documentation/config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2795,7 +2795,7 @@ splitIndex.sharedIndexExpire::
27952795
The default value is "2.weeks.ago".
27962796
Note that a shared index file is considered modified (for the
27972797
purpose of expiration) each time a new split-index file is
2798-
created based on it.
2798+
either created based on it or read from it.
27992799
See linkgit:git-update-index[1].
28002800

28012801
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 repositories with very large indexes, and
397+
aims at reducing the time it takes to repeatedly write these indexes.
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 modification time is older than what is
411+
specified by 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
415+
modification time is updated to the current time everytime a new split
416+
index based on the shared index file is either created or read from.
417+
397418
Untracked cache
398419
---------------
399420

0 commit comments

Comments
 (0)