Okay, I'll have a stab at explaining it.
For huge working directories, you usually have a huge number of trees. The
idea of cache_tree is to remember not only the stat information of the
blobs in the index, but to cache the hashes of the trees also (until they
are invalidated, e.g. by an update-index). This avoids recalculation of
the hashes when committing.
This cache is accessible by the global variable active_cache_tree. It is
best accessed by the function cache_tree_find(), which you call like that:
struct cache_tree *ct = cache_tree_find(active_cache_tree, path);
where the variable "path" may contain slashes. The SHA1 of the
corresponding tree is in ct->sha1, and you can check if the hash is still
valid by asking
if (cache_tree_fully_valid(ct))
/* still valid */
AFAIU Junio would like to take the shortcut of doing nothing at all when
(twoway) reading a tree whose hash is identical to the hash stored in the
corresponding cache_tree _and_ when the cache is still fully valid.
Ciao,
Dscho
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html