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

[PATCH] completion: recognize "--local" as a config file source

From
Jeff King <peff@peff.net>
Date
Feb 12, 2013, 05:49 UTC
Message-ID
<20130212054922.GA20129@sigill.intra.peff.net>
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
Previous: Jeff KingNext: Matthieu Moy
Message 3 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.