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

Re: [PATCH v2] completion: Handle '!f() { ... }; f' aliases

From
Steffen Prohaska <prohaska@zib.de>
Date
Jun 12, 2014, 18:41 UTC
Message-ID
<62610ABB-4ED5-4CF1-B5B2-B89C9DD22FBD@zib.de>
In-Reply-To
<xmqq1tuxcp13.fsf@gitster.dls.corp.google.com>
On Jun 10, 2014, at 7:27 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> Steffen Prohaska <prohaska@zib.de> writes:
> 
> I tend to prefer writing it like so instead:
> 
>    sh -c '...' -
> 
> so that I won't clobber "f" (or any other name).  I wonder if you
> can help users of this other pattern as well.
I'll send an updated patch that handles it.
Show 7 quoted lines
>> +test_expect_success 'completion uses <cmd> completion for alias !f() { VAR=val git <cmd> ... }' '
>> +	test_config alias.co "!f() { VAR=val git checkout ... ; } f" &&
> 
> Is it only "f" that is completed, or can I spell it using another
> arbitrary token, e.g.
> 
> 	test_config alias.co "!co () { git checkout ... } co"
Any token that starts with ! already worked before. 
The updated patch will also handle spaces before the parens.
	Steffen
Previous: Junio C HamanoNext: Steffen Prohaska
Message 5 of 6 in “completion: Handle '!f() { ... }; f' aliases”
  1. completion: Handle '!f() { ... }; f' aliasesSteffen Prohaska, Jun 7, 2014
  2. Eric SunshineJun 8, 2014
  3. completion: Handle '!f() { ... }; f' aliasesSteffen Prohaska, Jun 9, 2014
  4. Junio C HamanoJun 10, 2014
  5. Steffen ProhaskaJun 12, 2014
  6. completion: Handle '!f() { ... }; f' and "!sh -c '...'" aliasesSteffen Prohaska, Jun 12, 2014

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.