path: root/Documentation/technical/index-format.txt
diff options
authorNguyễn Thái Ngọc Duy <>2015-03-08 10:12:46 (GMT)
committerJunio C Hamano <>2015-03-12 20:45:18 (GMT)
commit1e8fef609e78110e276df633c5ba1fb1f1589fa5 (patch)
treec7ccbe9baf7e7b557fbfe77f406198cc5ce20939 /Documentation/technical/index-format.txt
parent7b6aff0655c965959a59cc7fa3ed51c2a1fbcd44 (diff)
untracked cache: guard and disable on system changes
If the user enables untracked cache, then - move worktree to an unsupported filesystem - or simply upgrade OS - or move the whole (portable) disk from one machine to another - or access a shared fs from another machine there's no guarantee that untracked cache can still function properly. Record the worktree location and OS footprint in the cache. If it changes, err on the safe side and disable the cache. The user can 'update-index --untracked-cache' again to make sure all conditions are met. This adds a new requirement that setup_git_directory* must be called before read_cache() because we need worktree location by then, or the cache is dropped. This change does not cover all bases, you can fool it if you try hard. The point is to stop accidents. Helped-by: Eric Sunshine <> Helped-by: brian m. carlson <> Helped-by: Torsten Bögershausen <> Signed-off-by: Nguyễn Thái Ngọc Duy <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Documentation/technical/index-format.txt')
1 files changed, 4 insertions, 0 deletions
diff --git a/Documentation/technical/index-format.txt b/Documentation/technical/index-format.txt
index db59a13..b7093af 100644
--- a/Documentation/technical/index-format.txt
+++ b/Documentation/technical/index-format.txt
@@ -242,6 +242,10 @@ Git index format
The extension starts with
+ - A sequence of NUL-terminated strings, preceded by the size of the
+ sequence in variable width encoding. Each string describes the
+ environment where the cache can be used.
- Stat data of $GIT_DIR/info/exclude. See "Index entry" section from
ctime field until "file size".