From: Lasse Makholm <lasse.makholm@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: git status reads too many files
Date: Mon, 21 Mar 2011 21:39:32 +0100 [thread overview]
Message-ID: <AANLkTikPL7Dx5AphGnd1TVAyLNgNh2WVd__Yom134VXb@mail.gmail.com> (raw)
In-Reply-To: <7vipvcs9xt.fsf@alter.siamese.dyndns.org>
On 21 March 2011 17:41, Junio C Hamano <gitster@pobox.com> wrote:
> Lasse Makholm <lasse.makholm@gmail.com> writes:
>
>> 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.
Yeah, I know, I was just proving a point... git reset (--hard?) HEAD
would achieve the same thing...
> 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.
I figured as much... My original thought of checkout ensuring an index
newer than any working file is stupid, of course, for a multitude of
reasons -- one of which is that the "next" timestamp may be a full 2
seconds away...
> Let me cook something real quick.
Sweet, thanks...
--
/Lasse
prev parent reply other threads:[~2011-03-21 20:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-21 12:40 git status reads too many files Lasse Makholm
2011-03-21 16:41 ` Junio C Hamano
2011-03-21 17:16 ` [PATCH 1/2] diff/status: refactor opportunistic index update Junio C Hamano
2011-03-21 18:46 ` Piotr Krukowiecki
2011-03-21 19:39 ` Junio C Hamano
2011-03-21 17:18 ` [PATCH 2/2] update $GIT_INDEX_FILE when there are racily clean entries Junio C Hamano
2011-03-21 21:23 ` Lasse Makholm
2011-03-22 0:26 ` Eric Raible
2011-03-21 20:39 ` Lasse Makholm [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTikPL7Dx5AphGnd1TVAyLNgNh2WVd__Yom134VXb@mail.gmail.com \
--to=lasse.makholm@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).