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

Re: latest stg/git commandline completions code

From
BBlaisorblade <blaisorblade@yahoo.it>
Date
Oct 25, 2005, 15:53 UTC
Message-ID
<200510251753.20164.blaisorblade@yahoo.it>
In-Reply-To
<tnxwtk1lj58.fsf@arm.com>
On Tuesday 25 October 2005 17:18, Catalin Marinas wrote:
> Blaisorblade <blaisorblade@yahoo.it> wrote:
> > I'm using stgit on the Linux kernel so when on a command I don't have tab
> > completion I add the needed one (having the time and feeling to do
> > it).
Show 5 quoted lines
> You can have a look at the tlacontrib project scripts (I can forward
> them to you since you would need tla/baz to clone/checkout the project
> and this procedure is a combination of 'tag' and 'get' commands). They
> automatically generate the commands together with the options and are
> later used in completion.
> Of course, your approach would work as well but it requires more
> maintance.

_Yes_, it wasn't ever intended to be published, and the help output doesn't seem, at a quick look, trivially parsable (the source is better to parse but I refuse that. Also, some options require still a special handling.

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'm not fluent in Python enough currently, but when I'll find time I'll probably study a bit reflection and write this down (my Python experience amounts to some random readings on reviews and a couple of days with Python docs).

> >> if so, do you have any more formalised distribution process (like a
> >> git repo!) rather than grabbing code out of email list postings? I
> >> can't seem to find much on google...
> > Well, Catalin's TODO included "bash completions", so I assume the
> > thing could be merged by him. Anyway, I'm attaching the current
> > version.
> When you think it is ready, I'm happy to include it (though I would
> prefer a more dynamic approach like the tla one but since I don't have
> time for it I'll just use yours).

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.

> Thanks.
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it
Previous: Catalin MarinasNext: Catalin Marinas
Message 3 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.