Re: [PATCH 00/12] completion: speed up refs completion

2017-02-06 Thread Jacob Keller
On Mon, Feb 6, 2017 at 11:36 AM, SZEDER Gábor  wrote:
> On Mon, Feb 6, 2017 at 7:31 PM, Jacob Keller  wrote:
>> On Fri, Feb 3, 2017 at 7:15 PM, Jacob Keller  wrote:
>>> I haven't had a chance to further investigate, but I tried this series
>>> out (from your github) and it appears that this series (or the
>>> previous series for __gitdir work) breaks "git log" ref completion.
>>> I'll have further details when I am able to investigate a it more.
>>>
>>> Thanks,
>>> Jake
>>
>> At first I had the same problem, but I verified by re-installing the
>> completion script and the problem appears to have gone away. I suspect
>> what happened is that the original time, I forgot to actually install
>> the new version of git, and only installed the completion script, so
>> when some of the commands were run with new options they (silently)
>> failed and the result was missing completion values.
>>
>> Once I properly re-installed everything it appears to work as
>> expected. I haven't found any other issues yet.
>
> Thanks, that's good to hear.
>
> Still, I'm a bit puzzled as to what exactly might have caused your
> problem.  Considering new options:
>
>   - the __gitdir()-related series added the 'git rev-parse
> --absolute-git-dir' option, but only ever used it if you invoked
> completion after 'git -C some/where'.
>
>  - The refs completion speedup didn't add any new options but started
>to use two that it previously didn't:
>
>- 'git for-each-ref --sort=' option, but that's with us since
>  the earliest ever 'for-each-ref' version from more than a decade
>  ago...
>
>- 'git for-each-ref' format modifier 'strip=2', which was
>  introduced in v2.7.1~15^2 (tag: do not show ambiguous tag names
>  as "tags/foo", 2016-01-25), only about a year ago.  Were you
>  using a pre-2.7.1 version when seeing the problems?
>
> Gábor

Nope. I was using some version of next at some point recently (less
than a couple months old). I do not know exactly what caused it, and
I'm not really able to find out because I can't reproduce it any more.
(after a fresh make install).

Thanks,
Jake


Re: [PATCH 00/12] completion: speed up refs completion

2017-02-06 Thread SZEDER Gábor
On Mon, Feb 6, 2017 at 7:31 PM, Jacob Keller  wrote:
> On Fri, Feb 3, 2017 at 7:15 PM, Jacob Keller  wrote:
>> I haven't had a chance to further investigate, but I tried this series
>> out (from your github) and it appears that this series (or the
>> previous series for __gitdir work) breaks "git log" ref completion.
>> I'll have further details when I am able to investigate a it more.
>>
>> Thanks,
>> Jake
>
> At first I had the same problem, but I verified by re-installing the
> completion script and the problem appears to have gone away. I suspect
> what happened is that the original time, I forgot to actually install
> the new version of git, and only installed the completion script, so
> when some of the commands were run with new options they (silently)
> failed and the result was missing completion values.
>
> Once I properly re-installed everything it appears to work as
> expected. I haven't found any other issues yet.

Thanks, that's good to hear.

Still, I'm a bit puzzled as to what exactly might have caused your
problem.  Considering new options:

  - the __gitdir()-related series added the 'git rev-parse
--absolute-git-dir' option, but only ever used it if you invoked
completion after 'git -C some/where'.

 - The refs completion speedup didn't add any new options but started
   to use two that it previously didn't:

   - 'git for-each-ref --sort=' option, but that's with us since
 the earliest ever 'for-each-ref' version from more than a decade
 ago...

   - 'git for-each-ref' format modifier 'strip=2', which was
 introduced in v2.7.1~15^2 (tag: do not show ambiguous tag names
 as "tags/foo", 2016-01-25), only about a year ago.  Were you
 using a pre-2.7.1 version when seeing the problems?

Gábor


Re: [PATCH 00/12] completion: speed up refs completion

2017-02-06 Thread Jacob Keller
On Fri, Feb 3, 2017 at 7:15 PM, Jacob Keller  wrote:
> I haven't had a chance to further investigate, but I tried this series
> out (from your github) and it appears that this series (or the
> previous series for __gitdir work) breaks "git log" ref completion.
> I'll have further details when I am able to investigate a it more.
>
> Thanks,
> Jake

At first I had the same problem, but I verified by re-installing the
completion script and the problem appears to have gone away. I suspect
what happened is that the original time, I forgot to actually install
the new version of git, and only installed the completion script, so
when some of the commands were run with new options they (silently)
failed and the result was missing completion values.

Once I properly re-installed everything it appears to work as
expected. I haven't found any other issues yet.

Regards,
Jake


Re: [PATCH 00/12] completion: speed up refs completion

2017-02-03 Thread Junio C Hamano
Jacob Keller  writes:

> On Thu, Feb 2, 2017 at 8:15 PM, Jacob Keller  wrote:
>> On Thu, Feb 2, 2017 at 6:53 PM, SZEDER Gábor  wrote:
>>> This series speeds up refs completion for large number of refs, partly
>>> by giving up disambiguating ambiguous refs (patch 6) and partly by
>>> ...
>>> It goes on top of the __gitdir() improvements series I just posted at:
>>>
>>>   http://public-inbox.org/git/20170203024829.8071-1-szeder@gmail.com/T/
>>>
>> Nice! This is something i've been bothered by in the past since
>> completion would take a rather long time!
>
> I haven't had a chance to further investigate, but I tried this series
> out (from your github) and it appears that this series (or the
> previous series for __gitdir work) breaks "git log" ref completion.
> I'll have further details when I am able to investigate a it more.

Thanks, both.  I'll look forward to how the story unfolds from
sidelines ;-)



Re: [PATCH 00/12] completion: speed up refs completion

2017-02-03 Thread Jacob Keller
On Thu, Feb 2, 2017 at 8:15 PM, Jacob Keller  wrote:
> On Thu, Feb 2, 2017 at 6:53 PM, SZEDER Gábor  wrote:
>> This series speeds up refs completion for large number of refs, partly
>> by giving up disambiguating ambiguous refs (patch 6) and partly by
>> eliminating most of the shell processing between 'git for-each-ref'
>> and 'ls-remote' and Bash's completion facility.  The rest is a bit of
>> preparatory reorganization, cleanup and bugfixes.
>>
>> The last patch touches the ZSH wrapper, too.  By a lucky educated
>> guess I managed to get it work on the first try, but I don't really
>> know what I've actually done, so...  ZSH users, please have a closer
>> look.
>>
>> At the end of this series refs completion from a local repository is
>> as fast as it can possibly get, at least as far as the completion
>> script is concerned, because it basically does nothing anymore :)  All
>> it does is run 'git for-each-ref' with assorted options to do all the
>> work, and feed its output directly, without any processing into Bash's
>> COMPREPLY array.  There is still room for improvements in the code
>> paths using 'git ls-remote', but for that we would need enhancements
>> to 'ls-remote'.
>>
>> It goes on top of the __gitdir() improvements series I just posted at:
>>
>>   http://public-inbox.org/git/20170203024829.8071-1-szeder@gmail.com/T/
>>
>> This series is also available at:
>>
>>   https://github.com/szeder/git completion-refs-speedup
>>
>
> Nice! This is something i've been bothered by in the past since
> completion would take a rather long time!
>
> Regards,
> Jake

I haven't had a chance to further investigate, but I tried this series
out (from your github) and it appears that this series (or the
previous series for __gitdir work) breaks "git log" ref completion.
I'll have further details when I am able to investigate a it more.

Thanks,
Jake


Re: [PATCH 00/12] completion: speed up refs completion

2017-02-02 Thread Jacob Keller
On Thu, Feb 2, 2017 at 6:53 PM, SZEDER Gábor  wrote:
> This series speeds up refs completion for large number of refs, partly
> by giving up disambiguating ambiguous refs (patch 6) and partly by
> eliminating most of the shell processing between 'git for-each-ref'
> and 'ls-remote' and Bash's completion facility.  The rest is a bit of
> preparatory reorganization, cleanup and bugfixes.
>
> The last patch touches the ZSH wrapper, too.  By a lucky educated
> guess I managed to get it work on the first try, but I don't really
> know what I've actually done, so...  ZSH users, please have a closer
> look.
>
> At the end of this series refs completion from a local repository is
> as fast as it can possibly get, at least as far as the completion
> script is concerned, because it basically does nothing anymore :)  All
> it does is run 'git for-each-ref' with assorted options to do all the
> work, and feed its output directly, without any processing into Bash's
> COMPREPLY array.  There is still room for improvements in the code
> paths using 'git ls-remote', but for that we would need enhancements
> to 'ls-remote'.
>
> It goes on top of the __gitdir() improvements series I just posted at:
>
>   http://public-inbox.org/git/20170203024829.8071-1-szeder@gmail.com/T/
>
> This series is also available at:
>
>   https://github.com/szeder/git completion-refs-speedup
>

Nice! This is something i've been bothered by in the past since
completion would take a rather long time!

Regards,
Jake


[PATCH 00/12] completion: speed up refs completion

2017-02-02 Thread SZEDER Gábor
This series speeds up refs completion for large number of refs, partly
by giving up disambiguating ambiguous refs (patch 6) and partly by
eliminating most of the shell processing between 'git for-each-ref'
and 'ls-remote' and Bash's completion facility.  The rest is a bit of
preparatory reorganization, cleanup and bugfixes.

The last patch touches the ZSH wrapper, too.  By a lucky educated
guess I managed to get it work on the first try, but I don't really
know what I've actually done, so...  ZSH users, please have a closer
look.

At the end of this series refs completion from a local repository is
as fast as it can possibly get, at least as far as the completion
script is concerned, because it basically does nothing anymore :)  All
it does is run 'git for-each-ref' with assorted options to do all the
work, and feed its output directly, without any processing into Bash's
COMPREPLY array.  There is still room for improvements in the code
paths using 'git ls-remote', but for that we would need enhancements
to 'ls-remote'.

It goes on top of the __gitdir() improvements series I just posted at:

  http://public-inbox.org/git/20170203024829.8071-1-szeder@gmail.com/T/

This series is also available at:

  https://github.com/szeder/git completion-refs-speedup


SZEDER Gábor (12):
  completion: remove redundant __gitcomp_nl() options from _git_commit()
  completion: wrap __git_refs() for better option parsing
  completion: support completing full refs after '--option=refs/'
  completion: support excluding full refs
  completion: don't disambiguate tags and branches
  completion: don't disambiguate short refs
  completion: let 'for-each-ref' and 'ls-remote' filter matching refs
  completion: let 'for-each-ref' strip the remote name from remote
branches
  completion: let 'for-each-ref' filter remote branches for 'checkout'
DWIMery
  completion: let 'for-each-ref' sort remote branches for 'checkout'
DWIMery
  completion: list only matching symbolic and pseudorefs when completing
refs
  completion: fill COMPREPLY directly when completing refs

 contrib/completion/git-completion.bash | 205 
 contrib/completion/git-completion.zsh  |   9 ++
 t/t9902-completion.sh  | 282 +
 3 files changed, 430 insertions(+), 66 deletions(-)

-- 
2.11.0.555.g967c1bcb3