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

Re: [PATCH] completion: support 'git config --local'

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 12, 2013, 17:34 UTC
Message-ID
<7vzjz9h1w0.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1360671642-10272-1-git-send-email-Matthieu.Moy@imag.fr>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
Show 18 quoted lines
> This needs to be done in two places: __git_config_get_set_variables to
> allow clever completion of "git config --local --get foo<tab>", and
> _git_config to allow "git config --loc<tab>" to complete to --local.
>
> While we're there, change the order of options in the code to match
> git-config.txt.
>
> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
> ---
>> I think this line should include --local:
>> 
>> https://github.com/git/git/blob/next/contrib/completion/git-completion.bash#L1782
>>     "--global|--system|--file=*)"
>> 
>> This would help for:
>>     git config -l --local
>
> Yes, but not only ;-)
I see the second hunk is new.  Comments?

How would this interract with the writing side of "git config"? "git config --local foo.bar value" and "git config foo.bar value" are the same, no?

Is it "yes they are the same but it does not hurt?"
Show 25 quoted lines
>  contrib/completion/git-completion.bash | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 5770b6f..2e1ad67 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1570,7 +1570,7 @@ __git_config_get_set_variables ()
>  	while [ $c -gt 1 ]; do
>  		word="${words[c]}"
>  		case "$word" in
> -		--global|--system|--file=*)
> +		--system|--global|--local|--file=*)
>  			config_file="$word"
>  			break
>  			;;
> @@ -1676,7 +1676,7 @@ _git_config ()
>  	case "$cur" in
>  	--*)
>  		__gitcomp "
> -			--global --system --file=
> +			--system --global --local --file=
>  			--list --replace-all
>  			--get --get-all --get-regexp
>  			--add --unset --unset-all
Previous: Matthieu MoyNext: Jeff King
Message 5 of 9 in “git-completion.bash --local”
  1. Dasa PaddockFeb 9, 2013
  2. Jeff KingFeb 11, 2013
  3. completion: recognize "--local" as a config file sourceJeff King, Feb 12, 2013
  4. completion: support 'git config --local'Matthieu Moy, Feb 12, 2013
  5. Junio C HamanoFeb 12, 2013
  6. Jeff KingFeb 12, 2013
  7. Junio C HamanoFeb 12, 2013
  8. Jeff KingFeb 13, 2013
  9. Matthieu MoyFeb 13, 2013

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.