zsh-workers
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: Frank Terbeck <ft@bewatermyfriend.org>,
	zsh-workers@zsh.org,  Nikolai Weibull <now@bitwi.se>
Subject: Re: Slowness issue with git completion
Date: Wed, 27 Apr 2011 00:35:10 +0300	[thread overview]
Message-ID: <BANLkTikLMKZmCAxt=Ac-t-R_ZccZMt3pqg@mail.gmail.com> (raw)
In-Reply-To: <BANLkTinadx+av3XhHrdem8aNqp=k7Gm69Q@mail.gmail.com>

On Wed, Apr 27, 2011 at 12:13 AM, Mikael Magnusson <mikachu@gmail.com> wrote:
> On 26 April 2011 23:10, Felipe Contreras <felipe.contreras@gmail.com> wrote:
>> On Tue, Apr 26, 2011 at 11:59 PM, Mikael Magnusson <mikachu@gmail.com> 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


  reply	other threads:[~2011-04-26 21:35 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-26 18:26 Felipe Contreras
2011-04-26 18:43 ` Frank Terbeck
2011-04-26 19:06   ` Nikolai Weibull
2011-04-26 20:10     ` Frank Terbeck
2011-04-26 20:23   ` Felipe Contreras
2011-04-26 20:34     ` Mikael Magnusson
2011-04-26 20:57       ` Felipe Contreras
2011-04-26 20:59         ` Mikael Magnusson
2011-04-26 21:10           ` Felipe Contreras
2011-04-26 21:13             ` Mikael Magnusson
2011-04-26 21:35               ` Felipe Contreras [this message]
2011-04-26 22:03                 ` Nikolai Weibull
2011-04-26 22:25                   ` Felipe Contreras
2011-04-26 23:14                     ` Benjamin R. Haskell
2011-04-27  7:01                       ` Benjamin R. Haskell
2011-04-27  1:52                     ` gi1242+zsh
2011-04-27  6:11                     ` Nikolai Weibull
2011-04-27  8:30                       ` Felipe Contreras
2011-04-27  8:47                         ` Frank Terbeck
2011-04-27  9:06                           ` Felipe Contreras
2011-04-27 10:15                         ` Nikolai Weibull
2011-04-27 10:42                           ` Felipe Contreras
2011-04-27 11:14                             ` Nikolai Weibull
2011-04-27  4:19                 ` Bart Schaefer
2011-04-27  6:13                   ` Nikolai Weibull
2011-04-27 12:51                   ` Nikolai Weibull
2011-04-27 14:55                     ` Bart Schaefer
2011-04-27 18:36                       ` Nikolai Weibull
2011-04-30 14:37                     ` Simon Ruderich
2011-04-30 15:00                       ` Simon Ruderich
2011-05-02  9:59                       ` Nikolai Weibull
2011-05-03 13:59                         ` Nikolai Weibull
2011-04-26 21:52         ` Benjamin R. Haskell
2011-04-26 22:04           ` Felipe Contreras
2011-04-26 22:35             ` Benjamin R. Haskell

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='BANLkTikLMKZmCAxt=Ac-t-R_ZccZMt3pqg@mail.gmail.com' \
    --to=felipe.contreras@gmail.com \
    --cc=ft@bewatermyfriend.org \
    --cc=mikachu@gmail.com \
    --cc=now@bitwi.se \
    --cc=zsh-workers@zsh.org \
    /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://git.vuxu.org/mirror/zsh/

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).