Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Improved completion for git commit objects (__git_commit_objects)



Mikael Magnusson wrote on Sat, Mar 07, 2015 at 13:59:39 +0100:
> On Sat, Mar 7, 2015 at 5:01 AM, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > % git ci --fixup=4<TAB>
> >> commit object name
> > 4bc554b  -- 34636: replace broken isprint() on Mac OS X
> > 42e5f59  -- 34640: clarify documentation for _guard function
> > 4edcacb  -- users/19934: document %D{...} for WATCHFMT
> > 49776e8  -- 34588: Complete 'usermod -a'
> 
> When I tried adding sha1 completion a few years ago, the big
> showstopper was that any completion of a commit-ish or any -ish for
> that matter, would take several minutes in the linux kernel, since it
> has millions of blobs. Is this faster?

It only completes hashes from 'git log -20 --pretty=%h', which should do
O(1) work regardless of repo size.

FWIW, on my datasets the completion of "--fix<TAB>" to "--fixup=" takes
longer than generating and displaying the completion suggestions upon
hitting <TAB> after the equal sign.  Even with cold caches on a 250MB
repo it takes just a few seconds.

Daniel



Messages sorted by: Reverse Date, Date, Thread, Author