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

Re: [PATCH v3 4/4] completion: fix remote.pushdefault

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 3, 2014, 21:21 UTC
Message-ID
<xmqqy52wlq2k.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1388779022-14536-5-git-send-email-artagnon@gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 7 quoted lines
> When attempting to complete
>
>   $ git config remote.push<TAB>
>
> 'pushdefault' doesn't come up. This is because "$cur" is matched with
> "remote.*" and a list of remotes are completed. Add 'pushdefault' to the
> list of remotes using __gitcomp_nl_append ().

"Add ... to the list of remotes" (same for "list of branches" in 3/4) sounds somewhat funny, doesn't it? How about

	Add remote.pushdefault as a candidate for completion, too.
or something like that instead?
Show 18 quoted lines
>
> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
> ---
>  contrib/completion/git-completion.bash | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 75c7302..345ceff 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1883,6 +1883,7 @@ _git_config ()
>  	remote.*)
>  		local pfx="${cur%.*}." cur_="${cur#*.}"
>  		__gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "."
> +		__gitcomp_nl_append "pushdefault" "$pfx" "$cur_"
>  		return
>  		;;
>  	url.*.*)
Previous: Ramkumar Ramachandra
Message 8 of 8 in “Fix branch.autosetup(merge|rebase) completion”
  1. 0/4 Fix branch.autosetup(merge|rebase) completionRamkumar Ramachandra, Jan 3, 2014
  2. 1/4 completion: prioritize ./git-completion.bashRamkumar Ramachandra, Jan 3, 2014
  3. 2/4 completion: introduce __gitcomp_nl_append ()Ramkumar Ramachandra, Jan 3, 2014
  4. Junio C HamanoJan 3, 2014
  5. Ramkumar RamachandraJan 5, 2014
  6. 3/4 completion: fix branch.autosetup(merge|rebase)Ramkumar Ramachandra, Jan 3, 2014
  7. 4/4 completion: fix remote.pushdefaultRamkumar Ramachandra, Jan 3, 2014
  8. Junio C HamanoJan 3, 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.