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

Re: [PATCH] completion: loosen and document the requirement around completing alias

From
LALinus Arver <linusa@google.com>
Date
Sep 22, 2023, 18:31 UTC
Message-ID
<owly34z6t5zg.fsf@fine.c.googlers.com>
In-Reply-To
<xmqqr0ms8yxs.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 41 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>>  * We've discussed this when we reviewed the topic that just hit
>>    'master'.  Before we forget...
>>
>>  contrib/completion/git-completion.bash | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> And here is an obligatory "test" update I will squash into the main
> patch.  The new ones copy a canonical ": git <cmd> ; ..."  test and
> remove 'git' and also the space before the semicolon.
>
> diff --git c/t/t9902-completion.sh w/t/t9902-completion.sh
> index 47e20fb8b1..a7c3b4eb63 100755
> --- c/t/t9902-completion.sh
> +++ w/t/t9902-completion.sh
> @@ -2464,6 +2464,24 @@ test_expect_success 'completion used <cmd> completion for alias: !f() { : git <c
>  	EOF
>  '
>  
> +test_expect_success 'completion used <cmd> completion for alias: !f() { : <cmd> ; ... }' '
> +	test_config alias.co "!f() { : checkout ; if ... } f" &&
> +	test_completion "git co m" <<-\EOF
> +	main Z
> +	mybranch Z
> +	mytag Z
> +	EOF
> +'
> +
> +test_expect_success 'completion used <cmd> completion for alias: !f() { : <cmd>; ... }' '
> +	test_config alias.co "!f() { : checkout; if ... } f" &&
> +	test_completion "git co m" <<-\EOF
> +	main Z
> +	mybranch Z
> +	mytag Z
> +	EOF
> +'
> +
>  test_expect_success 'completion without explicit _git_xxx function' '
>  	test_completion "git version --" <<-\EOF
>  	--build-options Z
LGTM, thanks!
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 12 in “completion: improve doc for complex aliases”
  1. completion: improve doc for complex aliasesPhilippe Blain via GitGitGadget, Sep 9, 2023
  2. Eric SunshineSep 10, 2023
  3. Linus ArverSep 12, 2023
  4. Philippe BlainSep 12, 2023
  5. completion: improve doc for complex aliasesPhilippe Blain via GitGitGadget, Sep 12, 2023
  6. Junio C HamanoSep 13, 2023
  7. Linus ArverSep 14, 2023
  8. Linus ArverSep 14, 2023
  9. completion: loosen and document the requirement around completing aliasJunio C Hamano, Sep 20, 2023
  10. Junio C HamanoSep 20, 2023
  11. Linus ArverSep 22, 2023
  12. Junio C HamanoSep 22, 2023

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.