Re: git status: small difference between stating whole repository and small subdirectory
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 20, 2012, 23:31 UTC
- Message-ID
- <7v8vjxjd47.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20120220224140.GA7116@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I still think replaying real-world test cases is going to be more likely > to find issues in invalidation.
Yes, but it depends on what kind of replaying you have in mind. It is very hard to come up with "replaying real-world test case".
For example, randomly picking commit pair <$A,$B> from the kernel repository and running
git reset --hard $A
git checkout $B
T0=$(git write-tree)
drop-cache-tree
T1=$(git write-tree)
test "$T0" = "$T1" && test "$T0" = $(git rev-parse $B^{tree})is necessary but I do not think that is sufficient. We also want to do something like:
git reset --hard $A
... modify paths that do not change between $A and $B
... git add these paths
git write-tree
git checkout $Bwith and without the "git write-tree" to see the part of the cache-tree smudged by the modification behaves sanely. The codepath that is used to deal with the case where the index does not match $A but matches $B is also different, so the "modify path and git add" step would have to be crafted carefully to touch all bases.