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

[PATCH] git-config: better document default behavior for `--include`

From
Jeff King <peff@peff.net>
Date
Jan 19, 2015, 19:58 UTC
Message-ID
<20150119195847.GA8945@peff.net>
In-Reply-To
<54BD5CE6.2060309@garrison.cc>
On Mon, Jan 19, 2015 at 11:37:10AM -0800, Jim Garrison wrote:
> I have found that `git config --global` does not pick up any include
> directives in the git config file.

That's by design. You asked for the entries in a specific file, and we do not follow any includes by default in that case. You can use `--include` if you want to follow includes.

The documentation is quite misleading here, though. Here's a patch.
-- >8 --
Subject: git-config: better document default behavior for `--include`

As described in the commit message of 9b25a0b (config: add include directive, 2012-02-06), the `--include` option is only on by default in some cases. But our documentation described it as just "defaults to on", which doesn't tell the whole story.

Signed-off-by: Jeff King <peff@peff.net>
---
 Documentation/git-config.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 9dfa1a5..d42c062 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -215,7 +215,9 @@ See also <<FILES>>.
 
 --[no-]includes::
 	Respect `include.*` directives in config files when looking up
-	values. Defaults to on.
+	values. Defaults to `off` when a specific file is given (e.g.,
+	using `--file`, `--global`, etc) and `on` when searching all
+	config files.
 
 [[FILES]]
 FILES
-- 
2.2.1.425.g441bb3c
Previous: Jim Garrison
Message 2 of 2 in “git config --global not picking up includes”
  1. Jim GarrisonJan 19, 2015
  2. git-config: better document default behavior for `--include`Jeff King, Jan 19, 2015

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.