git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jacob Keller <jacob.keller@gmail.com>
Date
Feb 4, 2017, 03:15 UTC
Message-ID
<CA+P7+xpeyebN3pmSX09Avh1EvYVjALpBCQ9r2==q3SWTu3GMSw@mail.gmail.com>
In-Reply-To
<CA+P7+xqhjVQMXtO4gtQ_2VAVd3qrpVLncH6YpFHreVV2mHORxg@mail.gmail.com>
On Thu, Feb 2, 2017 at 8:15 PM, Jacob Keller <jacob.keller@gmail.com> wrote:
Show 35 quoted lines
> On Thu, Feb 2, 2017 at 6:53 PM, SZEDER Gábor <szeder.dev@gmail.com> 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.dev@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

Previous: Jacob KellerNext: Junio C Hamano
Message 19 of 23 in “completion: speed up refs completion”
  1. 00/12 completion: speed up refs completionSZEDER Gábor, Feb 3, 2017
  2. 01/12 completion: remove redundant __gitcomp_nl() options from _git_commit()SZEDER Gábor, Feb 3, 2017
  3. 02/12 completion: wrap __git_refs() for better option parsingSZEDER Gábor, Feb 3, 2017
  4. 07/12 completion: let 'for-each-ref' and 'ls-remote' filter matching refsSZEDER Gábor, Feb 3, 2017
  5. 03/12 completion: support completing full refs after '--option=refs/<TAB>'SZEDER Gábor, Feb 3, 2017
  6. 08/12 completion: let 'for-each-ref' strip the remote name from remote branchesSZEDER Gábor, Feb 3, 2017
  7. 12/12 completion: fill COMPREPLY directly when completing refsSZEDER Gábor, Feb 3, 2017
  8. squash! completion: fill COMPREPLY directly when completing refsSZEDER Gábor, Feb 6, 2017
  9. Junio C HamanoFeb 10, 2017
  10. SZEDER GáborFeb 13, 2017
  11. Junio C HamanoFeb 13, 2017
  12. 10/12 completion: let 'for-each-ref' sort remote branches for 'checkout' DWIMerySZEDER Gábor, Feb 3, 2017
  13. 11/12 completion: list only matching symbolic and pseudorefs when completing refsSZEDER Gábor, Feb 3, 2017
  14. 06/12 completion: don't disambiguate short refsSZEDER Gábor, Feb 3, 2017
  15. 04/12 completion: support excluding full refsSZEDER Gábor, Feb 3, 2017
  16. 05/12 completion: don't disambiguate tags and branchesSZEDER Gábor, Feb 3, 2017
  17. 09/12 completion: let 'for-each-ref' filter remote branches for 'checkout' DWIMerySZEDER Gábor, Feb 3, 2017
  18. Jacob KellerFeb 3, 2017
  19. Jacob KellerFeb 4, 2017
  20. Junio C HamanoFeb 4, 2017
  21. Jacob KellerFeb 6, 2017
  22. SZEDER GáborFeb 6, 2017
  23. Jacob KellerFeb 6, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.