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

Re: [StGIT PATCH] StGIT bash completion

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Nov 16, 2006, 16:12 UTC
Message-ID
<b0943d9e0611160812s6ffec19fm4bf079e08e5fce01@mail.gmail.com>
In-Reply-To
<20061116154002.GA20729@diana.vm.bytemark.co.uk>
On 16/11/06, Karl Hasselström <kha@treskal.com> wrote:
Show 11 quoted lines
> On 2006-11-16 14:21:27 +0000, Catalin Marinas wrote:
> > 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
Previous: Karl HasselströmNext: Karl Hasselström
Message 5 of 6 in “StGIT bash completion”
  1. StGIT bash completionKarl Hasselström, Nov 12, 2006
  2. Shawn PearceNov 13, 2006
  3. Catalin MarinasNov 16, 2006
  4. Karl HasselströmNov 16, 2006
  5. Catalin MarinasNov 16, 2006
  6. Karl HasselströmNov 16, 2006

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.