git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jim Garrison <jim@garrison.cc>
Cc: git@vger.kernel.org
Subject: [PATCH] git-config: better document default behavior for `--include`
Date: Mon, 19 Jan 2015 14:58:47 -0500	[thread overview]
Message-ID: <20150119195847.GA8945@peff.net> (raw)
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

      reply	other threads:[~2015-01-19 19:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19 19:37 git config --global not picking up includes Jim Garrison
2015-01-19 19:58 ` Jeff King [this message]

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=20150119195847.GA8945@peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=jim@garrison.cc \
    /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).