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

Re: latest stg/git commandline completions code

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Oct 25, 2005, 16:24 UTC
Message-ID
<b0943d9e0510250924g3f5d9281r@mail.gmail.com>
In-Reply-To
<200510251753.20164.blaisorblade@yahoo.it>
On 25/10/05, Blaisorblade <blaisorblade@yahoo.it> wrote:
> The best idea seems to write a Python script sourcing the Stgit source
> (stgit/main.py to get commands, and then loading each class and iterating
> over the "options" module member).

I can add a function in stgit/main.py which would list the options. The tla-completion generates a file listing a command with its option on every line:

  push -a -all -n --number -t --to --reverse --undo -h --help
  ...

Since I don't know much about the bash completion, let me know of the format you'd prefer.

> Btw, what do you think about speeding up completions by reimplementing things
> like "stg applied" or "stg unapplied" via cat (as noted in the comments at
> the beginning of the script)? Tab completions can easily livelock a shell on
> a busy system, so it's worthy speeding the thing up.

In general, it is better to use the stg commands but the repository structure won't probably change for a long time and it's OK to optimise (if the speed improvement is visible). Anyway, these particular commands are pretty fast (they behave like cat) but there are others which are slower (usually the commands involving calls to the GIT tool).

-- Catalin

Previous: BlaisorbladeNext: Blaisorblade
Message 4 of 14 in “Re: latest stg/git commandline completions code”
  1. BlaisorbladeOct 25, 2005
  2. Catalin MarinasOct 25, 2005
  3. BlaisorbladeOct 25, 2005
  4. Catalin MarinasOct 25, 2005
  5. BlaisorbladeOct 25, 2005
  6. Catalin MarinasOct 26, 2005
  7. BlaisorbladeOct 26, 2005
  8. Ben CliffordNov 8, 2005
  9. Petr BaudisNov 9, 2005
  10. Ben CliffordNov 10, 2005
  11. Ben CliffordNov 10, 2005
  12. Ben CliffordNov 10, 2005
  13. Petr BaudisNov 10, 2005
  14. Ben CliffordNov 16, 2005

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.