Documentation/git-update-index: explain splitIndex.*

Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Couder committed Mar 6, 2017 at 10:42 UTC b46013950aff31b6626af96ccbf2c48469e36c66
2 files changed +30 -9
Documentation/config.txt
+1 -1
@@ -2795,7 +2795,7 @@ splitIndex.sharedIndexExpire::
2795 The default value is "2.weeks.ago".
2796 Note that a shared index file is considered modified (for the
2797 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.
2799 See linkgit:git-update-index[1].
2800
2801 status.relativePaths::
Documentation/git-update-index.txt
+29 -8
@@ -163,14 +163,10 @@ may not support it yet.
163
164 --split-index::
165 --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.
170 +
171 These options take effect whatever the value of the `core.splitIndex`
172 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
390 different from assume-unchanged bit's. Skip-worktree also takes
391 precedence over assume-unchanged bit when both are set.
392
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 +
418 Untracked cache
419 ---------------
420