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

Re: [StGIT PATCH] StGIT bash completion

From
Karl Hasselström <kha@treskal.com>
Date
Nov 16, 2006, 16:29 UTC
Message-ID
<20061116162958.GB20729@diana.vm.bytemark.co.uk>
In-Reply-To
<b0943d9e0611160812s6ffec19fm4bf079e08e5fce01@mail.gmail.com>
On 2006-11-16 16:12:43 +0000, Catalin Marinas wrote:
Show 5 quoted lines
> 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
Previous: Catalin Marinas
Message 6 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.