On Tue, 10 Jun 2008, Ben Lynn wrote: > > Am I going crazy? All of a sudden I think I can get away without a > size zero hack. How about this smudging routine: > > if (!ce_match_stat_basic(ce, &st)) { > recompute_sha1_and_update_index(); // no other checks required > } No. You can't recompute the sha1. That SHA1 is what the user asked us to remember - whether smudged or not. So you mustn't change it, until the user does a "git add" or "git update-index" (or anything that implicitly does the same). You can change the _stat_ information, since that is only used for matching the tree (positively or negatively), but the SHA1 itself is not just a cache, it's the "pending state" in the index. So smudging must change some piece of data that is only about the stat cache - the st_size, the mtime, anything like that. Linus -- 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