Thread (6 messages) flat view 6 messages, 3 authors, 2016-08-11

Re: [StGIT PATCH] StGIT bash completion

From: Karl Hasselström <hidden>
Date: 2016-08-11 19:27:55

On 2006-11-16 16:12:43 +0000, Catalin Marinas wrote:
Indeed, stg help takes over 200ms on my machine as well, with hot
caches but this is mainly because it imports all the
stgit.commands.* modules in order to read the short description. The
'stg help <command>' takes around 90ms on my machine since it only
imports one module
Excellent. However, this suggests that an option should be added to
stg that makes it print just the subcommand names, without importing
anything, to get this kind of speed there as well. Call it
--generate-tab-completion or something, and don't print it in the help
output.
(I actually reduced it to 85ms by minimizing the imports even
further).
Goodie. For reference, I think git was able to list its subcommands in
about 20 ms. Just so you know what to aim for. :-)
I could actually hard-code the commands only in the script. At the
moment I removed the _stg_* functions and added some common
_stg_all_patches() to avoid duplicating the code (see attached).
Seems reasonable.

Next time I do some StGIT hacking (not this weekend, unfortunately), I
was planning to build more tab-completion stuff. On top of my list are
fixing basic completion for all subcommands, and fixing some kind of
filename completion. But do feel free to do it first if you like. :-)

-- 
Karl Hasselström, kha@treskal.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help