git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Joey Hess <joey@kitenet.net>, GIT Mailing-list <git@vger.kernel.org>
Subject: Re: speed of git reset -- file
Date: Wed, 1 Jun 2011 15:58:31 -0400	[thread overview]
Message-ID: <20110601195831.GA30070@sigill.intra.peff.net> (raw)
In-Reply-To: <7v62oqignm.fsf@alter.siamese.dyndns.org>

On Tue, May 31, 2011 at 04:39:25PM -0700, Junio C Hamano wrote:

> "git reset" has always refreshed the index. If somebody _really_ wants to
> introduce a slight inconsistency to "git reset" so that only in "per-path"
> mode it doesn't refresh, the call to refresh_index() can easily be removed
> from update_index_refresh(). There is no "we end up having to".
> 
> IOW, we refresh by choice, design and inertia ;-).

Ah, yeah, I really wasn't thinking of the fact that refreshing is a
user-facing operation. These days most of the porcelain commands will do
it for you automatically, so it's easy to forget.

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. Lots of other commands will end up stat'ing
everything, anyway. Users with giant repos or slow stat calls are
probably better off using assume-unchanged, which would help this and
many other situations.

-Peff

  reply	other threads:[~2011-06-01 19:58 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 [this message]
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

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=20110601195831.GA30070@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=joey@kitenet.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 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).