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

Re: gitconfig includes

From
Eli Barzilay <eli@barzilay.org>
Date
Nov 30, 2016, 19:42 UTC
Message-ID
<CALO-guvsVgHp41ubvuKzmH3c4rE+3io3GaYie3=Q-4jdG91CDQ@mail.gmail.com>
In-Reply-To
<20161130190653.kk5pboas54yen2it@sigill.intra.peff.net>
On Wed, Nov 30, 2016 at 2:06 PM, Jeff King <peff@peff.net> wrote:
Show 11 quoted lines
>
> I'm not sure what your script does exactly, but in general I think the
> right thing for most scripts is _not_ to use a specific-file option
> like --global.
>
> If the script is looking up a config value on behalf of a user, it
> probably makes sense for it to use the normal config lookup procedure
> (system, global, repo, command-line), which also enables includes by
> default. That would make it consistent with internal git config
> lookups (e.g., user.name probably only ever appears in global config,
> but you _can_ override it at the repo level if you want to).

This is intended for git newbies (and big company => infinite supply of them), and also allows them to conveniently nuke the repo and start from a fresh copy, so it makes sense to make the script inspect/tweak the global settings. If knowing git "well enough" was an assumed requirement, I'd definitely do the normal thing.

> I know that's mostly orthogonal to what we're discussing, but I'd feel
> more convinced that enabling "--includes" with "--global" is useful if
> I thought that "--global" was useful in the first place outside of a
> few narrow debugging cases.

Ok. Perhaps I overestimated the utility of --global anyway, given the above...

-- 
                   ((x=>x(x))(x=>x(x)))                  Eli Barzilay:
                   http://barzilay.org/                  Maze is Life!
Previous: Jeff King
Message 8 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.