Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Slowness issue with git completion
- X-seq: zsh-workers 29066
- From: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Subject: Re: Slowness issue with git completion
- Date: Wed, 27 Apr 2011 00:35:10 +0300
- Cc: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>, zsh-workers@xxxxxxx, Nikolai Weibull <now@xxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=w55ivI4HCzSaQh7MUsj9B7EryxQTYmAvh45/DPK3ZlU=; b=j0KaFVGkhvOpIWWwts9C/4CdbsqOFyQFMLind999+XuHV3yGaFA5CL4vOaDvXPsqz+ /hr+eBmzoKsxtN+fcbVgtzKBUhKnsBj00Zmvuj4bwc6PV31Tano2OuxmGaBw1R/rL88W oIs17JswMYhAKKk6OuUsHNRYB2DuerCy0vAck=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=hJow1t/ycwt9sURDclLSyUFVfSwbX0R5Ro6uYKTcBztU6s0degF2YjvfpgwBi/PKT4 3alcllRi5/I72myRGCUmtTeIfwuzfcsEFXWLUoAIx1JEzERZqpHb2gYRGoGRuo+O5npS 9YYn9+GI80qSnERTjWHsXnJNP8ePa60P9KGT0=
- In-reply-to: <BANLkTinadx+av3XhHrdem8aNqp=k7Gm69Q@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <BANLkTinKo=W8umz=JfneD3MNYdmv=xYhFQ@mail.gmail.com> <87liyw7t0o.fsf@ft.bewatermyfriend.org> <BANLkTim6WJWCrfLokA045Sc8su8DMXnKNw@mail.gmail.com> <BANLkTi=eLWad_TB4L=chD=3Fb_Pd9AQyqQ@mail.gmail.com> <BANLkTi=PrLsikjVhA-e06gjEkkxDpsdVaw@mail.gmail.com> <BANLkTi=N0DjXbf70LCo422DQ_2b0_dK_AQ@mail.gmail.com> <BANLkTikwk=OUQ7TzQB6FNcD2wztj+LHOGw@mail.gmail.com> <BANLkTinadx+av3XhHrdem8aNqp=k7Gm69Q@mail.gmail.com>
On Wed, Apr 27, 2011 at 12:13 AM, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> On 26 April 2011 23:10, Felipe Contreras <felipe.contreras@xxxxxxxxx> wrote:
>> On Tue, Apr 26, 2011 at 11:59 PM, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>>>>> git accepts files with or without a --
>>>>
>>>> So?
>>>
>>> So if the command works, we should complete it.
>>
>> Even if it's so slow that it is unusable? I don't understand the urge
>> to have that, nobody seems to be complaining about that behavior with
>> the bash completion. Even git itself warns when you have a ref and a
>> file that are ambiguous; you need to manually add "--".
>
> It's only slow in repos as large as the linux one.
No. It's slow everywhere, it's *dead* slow on Linux. And BTW, there's
thousands of developers working on Linux (the kernel), I guess we are
not important.
I just tried on one of my projects that has only 67 files, it took
almost two seconds. That's completely unacceptable; you are blowing
git's performance away.
>> BTW. The actual behavior is: if there's a ref, go for refs, if there's
>> no ref, try the files. So 'git show v' first would show the version
>> refs, but 'git show vi' will show the 'virt' directory. I don't see
>> how that is so atrocious. You can still auto-complete commands that
>> work.
>>
>>>>>> Moreover, why do you want to be smarter than git? There are ways to
>>>>>> ask git precisely what we want: list the contents of certain tree-ish
>>>>>> on-demand. And in fact, that's exactly what the bash completion does:
>>>>>>
>>>>>> time git ls-tree HEAD -- (0m0.005s)
>>>>>> time git ls-tree HEAD -- drivers/ (0m0.007s)
>>>>>
>>>>> git ls-tree doesn't allow you to filter the output files by 'changed',
>>>>> 'new', 'unknown' etc etc.
>>>>
>>>> So?
>>>
>>> So we can use ls-tree for log i guess, but not for much else, git add
>>> will still be slow for example.
>>
>> Why do you need any git command at all to find completions for 'git
>> add'? Just use the normal local file completion.
>
> Because you don't want to complete unchanged files when adding?
Didn't you just said "if the command works, we should complete it"?
But what is the real advantage? That only one file would be listed
instead of a couple? Well, that would be nice, if it didn't take 10
seconds to do that. I would rather pick the right file myself, that's
faster.
Moreover, if you really want that, it's much easer to first find the
local files, and _then_ find they have been unchanged.
time git ls-files --modified --other -z -- > /dev/null (0m7.640s)
time git ls-files --modified --other -z -- 'M*' > /dev/null (0m2.224s)
That's dropping caches.
Cheers.
--
Felipe Contreras
Messages sorted by:
Reverse Date,
Date,
Thread,
Author