git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Ben Peart <peartben@gmail.com>, Git List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>,
	Ben Peart <benpeart@microsoft.com>
Subject: Re: [PATCH v1 1/2] reset: don't compute unstaged changes after reset when --quiet
Date: Wed, 17 Oct 2018 14:22:56 -0400	[thread overview]
Message-ID: <20181017182255.GC28326@sigill.intra.peff.net> (raw)
In-Reply-To: <CAPig+cSiE-M9QMch4WE7y4cib1FBUNiaR2pGGtbDuqiz6juhaw@mail.gmail.com>

On Wed, Oct 17, 2018 at 02:14:32PM -0400, Eric Sunshine wrote:

> > diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
> > @@ -95,7 +95,9 @@ OPTIONS
> >  --quiet::
> > -       Be quiet, only report errors.
> > +       Be quiet, only report errors.  Can optimize the performance of reset
> > +       by avoiding scaning all files in the repo looking for additional
> > +       unstaged changes.
> 
> s/scaning/scanning/
> 
> However, I'm not convinced that this should be documented here or at
> least in this fashion. When I read this new documentation before
> reading the commit message, I was baffled by what it was trying to say
> since --quiet'ness is a superficial quality, not an optimizer. My
> knee-jerk reaction is that it doesn't belong in end-user documentation
> at all since it's an implementation detail, however, I can see that
> such knowledge could be handy for people in situations which would be
> helped by this. That said, if you do document it, this doesn't feel
> like the correct place to do so; it should be in a "Discussion"
> section or something. (Who would expect to find --quiet documentation
> talking about optimizations? Likely, nobody.)

Yeah, I had the same thought. You'd probably choose --quiet because you
want it, you know, quiet.

Whereas for the new config variable, you'd probably set it not because
you want it quiet all the time, but because you want to get some time
savings. So there it does make sense to me to explain.

Other than that, this seems like an obvious and easy win. It does feel a
little hacky (you're really losing something in the output, and ideally
we'd just be able to give that answer quickly), but this may be OK as a
hack in the interim.

The sad thing is just that it's user-facing, so we have to respect it
forever. I almost wonder if there should be a global core.optimizeMessages
or something that tries to tradeoff less information for speed in all
commands, but makes no promises about which. Then a user with a big repo
who sets it once will get the benefit as more areas are identified (I
think "status" already has a similar case with ahead/behind)? And vice
versa, as some messages get faster to produce, they can be dropped from
that option.

I dunno. Maybe that is a stupid idea, and people really do want to
control it on a per-message basis.

-Peff

  reply	other threads:[~2018-10-17 18:22 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-17 16:40 [PATCH v1 0/2] speed up git reset Ben Peart
2018-10-17 16:40 ` [PATCH v1 1/2] reset: don't compute unstaged changes after reset when --quiet Ben Peart
2018-10-17 18:14   ` Eric Sunshine
2018-10-17 18:22     ` Jeff King [this message]
2018-10-18  3:40       ` Junio C Hamano
2018-10-18  6:36         ` Jeff King
2018-10-18 18:15           ` Ben Peart
2018-10-18 18:26             ` Duy Nguyen
2018-10-18 19:03               ` Ben Peart
2018-10-19  0:34             ` Junio C Hamano
2018-10-17 16:40 ` [PATCH v1 2/2] reset: add new reset.quietDefault config setting Ben Peart
2018-10-17 18:19   ` Eric Sunshine
2018-10-17 18:23     ` Jeff King
2018-10-23  9:13       ` Ævar Arnfjörð Bjarmason
2018-10-23 18:11         ` Ben Peart
2018-10-23 20:02           ` Jeff King
2018-10-23 20:03           ` Ævar Arnfjörð Bjarmason
2018-10-24 15:48             ` Recommended configurations (was Re: [PATCH v1 2/2] reset: add new reset.quietDefault config setting) Derrick Stolee
2018-10-24 23:58               ` Jeff King
2018-10-25  4:09                 ` Junio C Hamano
2018-10-19 16:12 ` [PATCH v2 0/3] speed up git reset Ben Peart
2018-10-19 16:12   ` [PATCH v2 1/3] reset: don't compute unstaged changes after reset when --quiet Ben Peart
2018-10-19 16:12   ` [PATCH v2 2/3] reset: add new reset.quiet config setting Ben Peart
2018-10-19 16:36     ` Eric Sunshine
2018-10-19 16:46       ` Jeff King
2018-10-19 17:10         ` Eric Sunshine
2018-10-19 17:11           ` Jeff King
2018-10-19 17:23             ` Ben Peart
2018-10-19 19:08               ` Jeff King
2018-10-22  5:04               ` Junio C Hamano
2018-10-19 17:11         ` Ben Peart
2018-10-19 16:12   ` [PATCH v2 3/3] reset: warn when refresh_index() takes more than 2 seconds Ben Peart
2018-10-22 13:18 ` [PATCH v3 0/3] speed up git reset Ben Peart
2018-10-22 13:18   ` [PATCH v3 1/3] reset: don't compute unstaged changes after reset when --quiet Ben Peart
2018-10-22 20:44     ` Johannes Schindelin
2018-10-22 22:07       ` Ben Peart
2018-10-23  8:53         ` Johannes Schindelin
2018-10-23 15:46         ` Duy Nguyen
2018-10-23 19:55           ` Johannes Schindelin
2018-10-22 13:18   ` [PATCH v3 2/3] reset: add new reset.quiet config setting Ben Peart
2018-10-22 14:45     ` Duy Nguyen
2018-10-23 18:47       ` Ben Peart
2018-10-24  2:56         ` Junio C Hamano
2018-10-24  7:21           ` Junio C Hamano
2018-10-24 14:54           ` Duy Nguyen
2018-10-25  1:12             ` Junio C Hamano
2018-10-24 14:49         ` Duy Nguyen
2018-10-22 19:13     ` Ramsay Jones
2018-10-22 20:06       ` Jeff King
2018-10-23 17:31         ` Ben Peart
2018-10-23 17:35           ` Jeff King
2018-10-22 13:18   ` [PATCH v3 3/3] reset: warn when refresh_index() takes more than 2 seconds Ben Peart
2018-10-23  0:23     ` Junio C Hamano
2018-10-23 17:12       ` Ben Peart
2018-10-23 19:04 ` [PATCH v4 0/3] speed up git reset Ben Peart
2018-10-23 19:04   ` [PATCH v4 1/3] reset: don't compute unstaged changes after reset when --quiet Ben Peart
2018-10-23 19:04   ` [PATCH v4 2/3] reset: add new reset.quiet config setting Ben Peart
2018-10-24  0:39     ` Ramsay Jones
2018-10-25  4:56       ` Junio C Hamano
2018-10-25  9:26         ` Junio C Hamano
2018-10-25 13:26           ` Ben Peart
2018-10-25 17:04           ` Ramsay Jones
2018-10-23 19:04   ` [PATCH v4 3/3] reset: warn when refresh_index() takes more than 2 seconds Ben Peart

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181017182255.GC28326@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=benpeart@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peartben@gmail.com \
    --cc=sunshine@sunshineco.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).