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

Re: [PATCH] git-completion.bash: always swallow error output of for-each-ref

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 13, 2016, 09:21 UTC
Message-ID
<alpine.DEB.2.20.1602131021170.2964@virtualbox>
In-Reply-To
<20160213020712.Horde.SM-rQbc5Jx1UwdYxdvNFNJx@webmail.informatik.kit.edu>
Hi Gábor,
On Sat, 13 Feb 2016, SZEDER Gábor wrote:
Show 25 quoted lines
>  $ cur=m ; time __gitcomp_nl "$(__git_refs '' 1)"
> 
>  real  0m7.641s
>  user  0m5.888s
>  sys   0m1.832s
> 
> Using 'refname:strip=2' for both 'git for-each-ref' in __git_refs():
> 
>  $ cur=m ; time __gitcomp_nl "$(__git_refs '' 1)"
> 
>  real  0m2.848s
>  user  0m2.308s
>  sys   0m0.596s
> 
> Quick'n'dirty PoC using 'refname:strip', '**' globbing and a few more
> tricks to let 'git for-each-ref' do the filtering instead of the
> shell loop behind __gitcomp_nl():
> 
>  $ cur=m ; time IFS=$'\n' COMPREPLY=( $(__git_refs_PoC '' 1) )
> 
>  real  0m0.247s
>  user  0m0.208s
>  sys   0m0.032s
> 
> Not bad for a Friday night, huh? :)
Nope, not bad at all. May I have that patch, please? ;-)

Ciao, Dscho

Previous: SZEDER GáborNext: SZEDER Gábor
Message 9 of 24 in “git-completion.bash: always swallow error output of for-each-ref”
  1. git-completion.bash: always swallow error output of for-each-refSebastian Schuberth, Feb 4, 2016
  2. Jeff KingFeb 4, 2016
  3. Johannes SchindelinFeb 4, 2016
  4. Jeff KingFeb 4, 2016
  5. Junio C HamanoFeb 4, 2016
  6. SZEDER GáborFeb 12, 2016
  7. Jeff KingFeb 12, 2016
  8. SZEDER GáborFeb 13, 2016
  9. Johannes SchindelinFeb 13, 2016
  10. SZEDER GáborFeb 13, 2016
  11. Johannes SchindelinFeb 13, 2016
  12. Jeff KingFeb 13, 2016
  13. SZEDER GáborFeb 12, 2016
  14. Jeff KingFeb 12, 2016
  15. Duy NguyenFeb 13, 2016
  16. Junio C HamanoFeb 12, 2016
  17. Jeff KingFeb 12, 2016
  18. Junio C HamanoFeb 12, 2016
  19. SZEDER GáborFeb 12, 2016
  20. Jeff KingFeb 12, 2016
  21. Junio C HamanoFeb 12, 2016
  22. Junio C HamanoFeb 23, 2016
  23. Sebastian SchuberthFeb 24, 2016
  24. Sebastian SchuberthFeb 12, 2016

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.