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

Re: [StGIT PATCH] StGIT bash completion

From: Catalin Marinas <hidden>
Date: 2016-08-11 20:24:23

On 16/11/06, Karl Hasselström [off-list ref] wrote:
On 2006-11-16 14:21:27 +0000, Catalin Marinas wrote:
quoted
Thanks for the patch. I modified it slightly to automatically
generate the options for other commands as well (by invoking "stg
help <command>" and it doesn't seem to be slow). I'll try to push it
tonight.
Hmm. I'll have to try it, but I was half planning to hard-code the
list of subcommands instead of calling "stg help" since it causes a
tangible delay. On the machines I've tried, it easily takes 0.2
seconds to run "stg help" (with hot caches; with cold caches, it's
_really_ bad), and that's bad for interactive behavior.
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 (I actually reduced it to 85ms by minimizing the imports even
further).

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).

-- 
Catalin

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help