git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "SZEDER Gábor" <szeder@ira.uka.de>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Sebastian Schuberth <sschuberth@gmail.com>,
	git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	tr@thomasrast.ch
Subject: Re: [PATCH] git-completion.bash: always swallow error output of for-each-ref
Date: Sat, 13 Feb 2016 11:57:23 -0500	[thread overview]
Message-ID: <20160213165722.GA30144@sigill.intra.peff.net> (raw)
In-Reply-To: <20160213020712.Horde.SM-rQbc5Jx1UwdYxdvNFNJx@webmail.informatik.kit.edu>

On Sat, Feb 13, 2016 at 02:07:12AM +0100, SZEDER Gábor wrote:

> >So I think switching to :strip is an improvement in both correctness
> >_and_ performance.
> 
> Right.  I was more worried about __git_refs(), because it asks for
> everything under refs/heads/, refs/tags/ and refs/remotes/, and its
> output is used in a lot more places and fed to a lot more commands than
> the output of __git_heads() (or __git_tags(), for that matter).  But I
> thought that a branch-tag ambiguity would cause git to error out
> complaining, just like in the case of ref-path ambiguity.  Successfully
> avoiding ambiguous refs for many years, I wasn't aware that 'git
> rev-parse' doesn't barf, but only warns and resolves the ambiguity in
> favor of the tag.

Yeah, switching to :strip would arguably be a regression when completing
all refs. Right now, you'd get "heads/foo" and "tags/foo" as part of
your completion (but _not_ just "foo"), and either works as a
non-ambiguous ref.

With :strip, you'd just get "foo" twice, and if you use the result of
the completion, it will always point to the tag.

So it is arguably worse. I still think it is worth trading off for
performance, but it is worth acknowledging in the commit message there
that it is a tradeoff.

> >I think it does already, since 4917e1e (Makefile: promote wildmatch to
> >be the default fnmatch implementation, 2013-05-30).
> 
> Things are looking up!
> [...vast improvement in times...]

Very cool. I look forward to seeing the final patch. :)

I have noticed in my pathological 10-million-ref bare repositories
(don't ask) that the __git_ps1() prompt is quite slow, too. And I
wondered if it could be related.

But I don't think it is. It's just literally that painful to look at the
packed-refs at all, and "git rev-parse HEAD" has to look at them to
resolve.

-Peff

  parent reply	other threads:[~2016-02-13 16:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-04 10:34 [PATCH] git-completion.bash: always swallow error output of for-each-ref Sebastian Schuberth
2016-02-04 11:13 ` Jeff King
2016-02-04 11:26   ` Johannes Schindelin
2016-02-04 11:45     ` Jeff King
2016-02-04 19:06     ` Junio C Hamano
2016-02-12 23:21     ` SZEDER Gábor
2016-02-12 23:40       ` Jeff King
2016-02-13  1:07         ` SZEDER Gábor
2016-02-13  9:21           ` Johannes Schindelin
2016-02-13 13:53             ` SZEDER Gábor
2016-02-13 17:14               ` Johannes Schindelin
2016-02-13 16:57           ` Jeff King [this message]
2016-02-12 23:43       ` SZEDER Gábor
2016-02-12 23:46         ` Jeff King
2016-02-13  0:53           ` Duy Nguyen
2016-02-12 20:00   ` Junio C Hamano
2016-02-12 20:10     ` Jeff King
2016-02-12 20:26       ` Junio C Hamano
2016-02-12 21:40     ` SZEDER Gábor
2016-02-12 22:16       ` Jeff King
2016-02-12 23:37         ` Junio C Hamano
2016-02-23 23:30           ` Junio C Hamano
2016-02-24  7:48             ` Sebastian Schuberth
2016-02-12  9:23 ` Sebastian Schuberth

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=20160213165722.GA30144@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sschuberth@gmail.com \
    --cc=szeder@ira.uka.de \
    --cc=tr@thomasrast.ch \
    /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).