174
175
--untracked-cache::
176
--no-untracked-cache::
177
- Enable or disable untracked cache extension. This could speed
178
- up for commands that involve determining untracked files such
179
- as `git status`. The underlying operating system and file
180
- system must change `st_mtime` field of a directory if files
181
- are added or deleted in that directory.
177
+ Enable or disable untracked cache feature. Please use
178
+ `--test-untracked-cache` before enabling it.
179
++
180
+These options take effect whatever the value of the `core.untrackedCache`
181
+configuration variable (see linkgit:git-config[1]). But a warning is
182
+emitted when the change goes against the configured value, as the
183
+configured value will take effect next time the index is read and this
184
+will remove the intended effect of the option.
185
186
--test-untracked-cache::
187
Only perform tests on the working directory to make sure
188
untracked cache can be used. You have to manually enable
186
- untracked cache using `--force-untracked-cache` (or
187
- `--untracked-cache` but this will run the tests again)
188
- afterwards if you really want to use it. If a test fails
189
- the exit code is 1 and a message explains what is not
190
- working as needed, otherwise the exit code is 0 and OK is
191
- printed.
189
+ untracked cache using `--untracked-cache` or
190
+ `--force-untracked-cache` or the `core.untrackedCache`
191
+ configuration variable afterwards if you really want to use
192
+ it. If a test fails the exit code is 1 and a message
193
+ explains what is not working as needed, otherwise the exit
194
+ code is 0 and OK is printed.
195
196
--force-untracked-cache::
194
- For safety, `--untracked-cache` performs tests on the working
195
- directory to make sure untracked cache can be used. These
196
- tests can take a few seconds. `--force-untracked-cache` can be
197
- used to skip the tests.
197
+ Same as `--untracked-cache`. Provided for backwards
198
+ compatibility with older versions of Git where
199
+ `--untracked-cache` used to imply `--test-untracked-cache` but
200
+ this option would enable the extension unconditionally.
201
202
\--::
203
Do not interpret any more arguments as options.
388
different from assume-unchanged bit's. Skip-worktree also takes
389
precedence over assume-unchanged bit when both are set.
390
391
+Untracked cache
392
+---------------
393
+
394
+This cache is meant to speed up commands that involve determining
395
+untracked files such as `git status`.
396
+
397
+This feature works by recording the mtime of the working tree
398
+directories and then omitting reading directories and stat calls
399
+against files in those directories whose mtime hasn't changed. For
400
+this to work the underlying operating system and file system must
401
+change the `st_mtime` field of directories if files in the directory
402
+are added, modified or deleted.
403
+
404
+You can test whether the filesystem supports that with the
405
+`--test-untracked-cache` option. The `--untracked-cache` option used
406
+to implicitly perform that test in older versions of Git, but that's
407
+no longer the case.
408
+
409
+If you want to enable (or disable) this feature, it is easier to use
410
+the `core.untrackedCache` configuration variable (see
411
+linkgit:git-config[1]) than using the `--untracked-cache` option to
412
+`git update-index` in each repository, especially if you want to do so
413
+across all repositories you use, because you can set the configuration
414
+variable to `true` (or `false`) in your `$HOME/.gitconfig` just once
415
+and have it affect all repositories you touch.
416
+
417
+When the `core.untrackedCache` configuration variable is changed, the
418
+untracked cache is added to or removed from the index the next time a
419
+command reads the index; while when `--[no-|force-]untracked-cache`
420
+are used, the untracked cache is immediately added to or removed from
421
+the index.
422
423
Configuration
424
-------------
444
something outside Git (file system crawlers and backup systems use
445
ctime for marking files processed) (see linkgit:git-config[1]).
446
447
+The untracked cache extension can be enabled by the
448
+`core.untrackedCache` configuration variable (see
449
+linkgit:git-config[1]).
450
451
SEE ALSO
452
--------