git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Dasa Paddock <dpaddock@esri.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: [PATCH] completion: recognize "--local" as a config file source
Date: Tue, 12 Feb 2013 00:49:22 -0500	[thread overview]
Message-ID: <20130212054922.GA20129@sigill.intra.peff.net> (raw)
In-Reply-To: <20130211210455.GB32740@sigill.intra.peff.net>

When we are trying to show the list of config variables in a
file, we recognize "--system", "--global", and "--file" as
specifying a particular file. This list misses "--local",
which performs a similar function.

Without this patch, completing:

  git config --get --local

shows items from all config files, not just the local one.

Noticed-by: Dasa Paddock <dpaddock@esri.com>
Signed-off-by: Jeff King <peff@peff.net>
---
 contrib/completion/git-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index c8452fb..0b7b659 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1779,7 +1779,7 @@ __git_config_get_set_variables ()
 	while [ $c -gt 1 ]; do
 		word="${words[c]}"
 		case "$word" in
-		--global|--system|--file=*)
+		--global|--system|--local|--file=*)
 			config_file="$word"
 			break
 			;;
-- 
1.8.1.2.11.g1a2f572

  reply	other threads:[~2013-02-12  5:49 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   ` Jeff King [this message]
2013-02-12 12:20 ` [PATCH] completion: support 'git config --local' Matthieu Moy
2013-02-12 17:34   ` 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=20130212054922.GA20129@sigill.intra.peff.net \
    --to=peff@peff.net \
    --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).