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

Re: [PATCH 2/2] completion: add docs on how to add subcommand completions

From
Roland Hieber <rhi@pengutronix.de>
Date
Apr 24, 2024, 21:41 UTC
Message-ID
<20240424214147.qlpyy3cdmb43n47v@pengutronix.de>
In-Reply-To
<xmqqedauxx2c.fsf@gitster.g>
On Wed, Apr 24, 2024 at 02:36:27PM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> Roland Hieber <rhi@pengutronix.de> writes:
> 
> > +# To add completion for git subcommands that live in external scripts,
> > +# define a function of the form '_git_${subcommand}' while replacing all dashes
> > +# with underscores, and the main git completion will make use of it.
> > +# For example, to add completeion after 'git do-my-stuff' (which could e.g. live
> > +# in /usr/bin/git-do-stuff), name the completion function '_git_do_stuff'.
> 
> You have either an extra "-my", or two "-my"s missing, in the above.

Ah, and I deleted one '-my' in the line before sending it… Will send a v2.

 - Roland
Show 7 quoted lines
> 
> > +# See _git_show, _git_bisect etc. below for more examples.
> > +#
> >  # Compatible with bash 3.2.57.
> >  #
> >  # You can set the following environment variables to influence the behavior of
> 
-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 6 in “completion: add 'symbolic-ref'”
  1. 1/2 completion: add 'symbolic-ref'Roland Hieber, Apr 24, 2024
  2. 2/2 completion: add docs on how to add subcommand completionsRoland Hieber, Apr 24, 2024
  3. Roland HieberApr 24, 2024
  4. Junio C HamanoApr 24, 2024
  5. Roland HieberApr 24, 2024
  6. Junio C HamanoApr 24, 2024

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.