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

Re: [PATCH 1/2] bash: Enable completion for external subcommands

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Feb 23, 2010, 15:50 UTC
Message-ID
<20100223155007.GB10772@neumann>
In-Reply-To
<1266936193-10644-1-git-send-email-teemu.matilainen@iki.fi>
Hi,
On Tue, Feb 23, 2010 at 04:43:12PM +0200, Teemu Matilainen wrote:
Show 15 quoted lines
> Now the parameter completion is only available for subcommands
> delivered with git.  Providers of external subcommands do not have
> a way to supply bash completion for their commands (other than
> instructing users to hack their git-completion.bash file).
>
> This makes it possible to have completion also for external git
> subcommands.  It can be provided by specifying a function (or a
> command in PATH) '_git_<subcommand>' that sets the environment
> variable COMPREPLY.
>
> All dashes (-) in the subcommand name are replaced with underscores
> (_).  E.g. completion for command 'git foo-bar' can be provided by
> '_git_foo_bar'.
>
> Signed-off-by: Teemu Matilainen <teemu.matilainen@iki.fi>

this issue was raised a few weeks ago, and the discussion led to a similar patch back then. However, Junio mentioned a few concerns regarding this approach, and, since it was v1.7.0-rc time and this was clearly a post v1.7.0 change, I didn't pursue the discussion and didn't send updated patches, and then forgot it completely. I will try to find some time in the evening to get the commit messages in shape send out the updates. In the meantime please have a look at Junio's concerns about this approach: http://thread.gmane.org/gmane.comp.version-control.git/138316/focus=138348

Best, Gábor

Previous: Teemu MatilainenNext: Teemu Matilainen
Message 3 of 4 in “bash: Enable completion for external subcommands”
  1. 1/2 bash: Enable completion for external subcommandsTeemu Matilainen, Feb 23, 2010
  2. 2/2 bash: Use dynamic binding for subcommand completion functionsTeemu Matilainen, Feb 23, 2010
  3. SZEDER GáborFeb 23, 2010
  4. Teemu MatilainenFeb 23, 2010

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.