git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@imag.fr>
To: git@vger.kernel.org, gitster@pobox.com
Cc: Dasa Paddock <dpaddock@esri.com>, Matthieu Moy <Matthieu.Moy@imag.fr>
Subject: [PATCH] completion: support 'git config --local'
Date: Tue, 12 Feb 2013 13:20:42 +0100	[thread overview]
Message-ID: <1360671642-10272-1-git-send-email-Matthieu.Moy@imag.fr> (raw)
In-Reply-To: <85E0E68E8961D64E9200C534AC5E1B240A443EDC@RED-INF-EXMB-P1.esri.com>

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 ;-)

 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
-- 
1.8.1.2.548.g956380a.dirty

  parent reply	other threads:[~2013-02-12 12:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-09 18:37 git-completion.bash --local Dasa Paddock
2013-02-11 21:04 ` Jeff King
2013-02-12  5:49   ` [PATCH] completion: recognize "--local" as a config file source Jeff King
2013-02-12 12:20 ` Matthieu Moy [this message]
2013-02-12 17:34   ` [PATCH] completion: support 'git config --local' Junio C Hamano
2013-02-12 21:11     ` Jeff King
2013-02-12 22:13       ` Junio C Hamano
2013-02-13  0:05         ` Jeff King
2013-02-13  7:44           ` Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360671642-10272-1-git-send-email-Matthieu.Moy@imag.fr \
    --to=matthieu.moy@imag.fr \
    --cc=dpaddock@esri.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).