Jakub Narebski <jnareb@xxxxxxxxx> writes: > Actually Git porcelain does use 'the index' as a cache (computing), > i.e. as a place to store redundant information (stat data, sha-1 > for trees with DIRC dircache extension) for faster access. This is an implementation optimization, that is not supposed to be visible for the user. Commands refering to the "cache" are not about stat data cache (e.g. "git diff --cached" is really about the content, not the stat cache). >> index: an 'index' is a guide of pointers to something else; a book >> index has a list of entries so the reader can locate information >> easily without having to go through the whole book. Git porcelain is >> not using the staging area to find out entries quicker; it's not an >> index. > > Actually 'the index' is index in that sense; it stores _references_ > from filename to file contents, using SHA-1 identifier of a file/tree > contents in place of page number in the book index. The SHA-1 > identifier of object which is stored in database of repository, not the > index itself. The implementation is done like this, but the user doesn't really care about this. For example, git-add(1) says "The index holds a snapshot of the content of the working tree", not "The index holds a set of references to sha1sums". There's no need to expose these two implementation details in the terminology used in the interface. Indeed, I've often seen people from other VCS confused by Git's index just because of the terminology. Because we sometimes call it "cache", they think it is basically a stat-cache, and wonder why it is shown to the user. I've even seen Git users think that others VCS didn't have a stat-cache because they had read that the "cache" was a unique Git feature. -- Matthieu Moy http://www-verimag.imag.fr/~moy/ -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html