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

Re: gitconfig includes

From
Jeff King <peff@peff.net>
Date
Nov 29, 2016, 21:46 UTC
Message-ID
<20161129214604.c5xcw3d2a5ydpx42@sigill.intra.peff.net>
In-Reply-To
<CALO-gutJbM=LA3q8vdmbQJLoeCFAJWfPHFo8f1vz-5KJHVxJ6g@mail.gmail.com>
On Tue, Nov 29, 2016 at 02:53:08PM -0500, Eli Barzilay wrote:
Show 12 quoted lines
> > This already is documented, and I think it is clear enough.
> >
> >        --[no-]includes
> >                   Respect include.* directives in config files when
> >                   looking up values.  Defaults to off when a specific
> >                   file is given (e.g., using --file, --global, etc)
> >                   and on when searching all config files.
> 
> Yeah, that's clear, sorry for not checking the latest.
> 
> [I'd expect/wish it to be on by default though...  Any reason for the
> default being off in these cases?]

It definitely needs to default to off for "-f", as we would not want surprises when accessing files like ".gitmodules" that come from untrusted sources.

I think it's arguable whether "--global" should behave the same. It makes the rule simple: "if you specify a single file, includes default to off". But I don't think there would be any particular harm. The existing default was mostly chosen for simplicity and least-surprise with respect to backwards compatibility.

There's a little more discussion in 9b25a0b52 (config: add include directive, 2012-02-06).

-Peff
Previous: Eli BarzilayNext: Junio C Hamano
Message 4 of 8 in “gitconfig includes”
  1. Eli BarzilayNov 29, 2016
  2. Junio C HamanoNov 29, 2016
  3. Eli BarzilayNov 29, 2016
  4. Jeff KingNov 29, 2016
  5. Junio C HamanoNov 29, 2016
  6. Eli BarzilayNov 30, 2016
  7. Jeff KingNov 30, 2016
  8. Eli BarzilayNov 30, 2016

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.