From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Joey Hess <joey@kitenet.net>, GIT Mailing-list <git@vger.kernel.org>
Subject: Re: speed of git reset -- file
Date: Wed, 01 Jun 2011 13:51:43 -0700 [thread overview]
Message-ID: <7vvcwpff6o.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20110601195831.GA30070@sigill.intra.peff.net> (Jeff King's message of "Wed, 1 Jun 2011 15:58:31 -0400")
Jeff King <peff@peff.net> writes:
> So implementing the "optimization" to drop the refresh here doesn't seem
> worth it. It inroduces an awful inconsistency, and it probably isn't
> saving much in practice...
You could make it less inconsistent by introducing core.autorefreshindex
for people who _do_ care about the latency. We already have a precedent in
diff.autorefreshindex and the new configuration would supercede it.
Usually we refresh the cached lstat information in the index at strategic
places so that later operations do not have to pay the penalty, but at the
same time, the higher level commands that want to make sure they are not
fooled by stale lstat differences do refresh the index themselves anyway,
so leaving cached stat information stale is not exactly the end of the
world.
All the high-level commands like "reset" that do _not_ absolutely need to
refresh the index for them to work, but do refresh the index to help later
invocation of other commands, could be taught to pay attention to the
core.autorefreshindex. After many operations the users usually do not see
changes from diff-files, people who set this to false will see phantom
changes due to stale cached lstat information, and they will see them
consistently. They know exactly when having up-to-date lstat information
in the index really matters, and they will run "update-index --refresh"
themselves when needed.
I however personally doubt it would be worth the effort. The _only_ person
who complained about this doesn't even use "update-index --refresh" but
uses "git status", which does more than refreshing the index, and seems to
think the extra latency coming from the overhead is acceptable.
So...
prev parent reply other threads:[~2011-06-01 20:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-31 19:00 speed of git reset -- file Joey Hess
2011-05-31 21:26 ` Jeff King
2011-05-31 21:54 ` Junio C Hamano
2011-05-31 22:13 ` Jeff King
2011-05-31 22:13 ` Matthieu Moy
2011-06-01 1:14 ` Nguyen Thai Ngoc Duy
2011-05-31 23:39 ` Junio C Hamano
2011-06-01 19:58 ` Jeff King
2011-06-01 20:16 ` Joey Hess
2011-06-01 21:18 ` Jeff King
2011-06-01 22:05 ` Joey Hess
2011-06-01 22:56 ` Jeff King
2011-06-01 23:31 ` Joey Hess
2011-06-02 3:18 ` Jeff King
2011-06-02 4:36 ` Joey Hess
2011-06-02 4:46 ` Joey Hess
2011-06-01 20:51 ` Junio C Hamano [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=7vvcwpff6o.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=joey@kitenet.net \
--cc=peff@peff.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.