Re: git status reads too many files
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 21, 2011, 16:41 UTC
- Message-ID
- <7vipvcs9xt.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <AANLkTikV4S51DXLADiRXWqjXdTD1OBLSdKjEWALZ9Ebh@mail.gmail.com>
Lasse Makholm <lasse.makholm@gmail.com> writes:
Show 12 quoted lines
> This persistent across multiple runs of git status: > > $ strace -o /tmp/trace2 git status > # On branch there > nothing to commit (working directory clean) > $ grep ^open /tmp/trace2 | wc -l > 414 > $ > > ...until the index is touched: > > $ touch .git/index
Don't do this; you are breaking the racy-git protection.
I think we opportunistically update the .git/index file in "git status" to refresh the stat bits (but we don't error out when we cannot write a new index, as you may be only browsing somebody else's repository with only a read access to it). It probably should be just the matter of adding a bit of logic to notice that your index is racily clean.
Let me cook something real quick.