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

RE: [PATCH v2] config: add string mapping for enum config_scope

From
mattr94@gmail.com <mattr94@gmail.com>
Date
Dec 12, 2019, 03:40 UTC
Message-ID
<1062901d5b09d$eafbc420$c0f34c60$@gmail.com>
In-Reply-To
<20191212031003.GA1196215@coredump.intra.peff.net>
From: Jeff King <peff@peff.net> 
Sent: Wednesday, December 11, 2019 10:10 PM
To: Emily Shaffer <emilyshaffer@google.com>
Cc: git@vger.kernel.org; Matthew Rogers <mattr94@gmail.com>; Philip Oakley <philipoakley@iee.email>
Subject: Re: [PATCH v2] config: add string mapping for enum config_scope
On Wed, Dec 11, 2019 at 03:38:20PM -0800, Emily Shaffer wrote:
> If a user is interacting with their config files primarily by the 'git 
> config' command, using the location flags (--global, --system, etc) 
> then they may be more interested to see the scope of the config file 
> they are editing, rather than the filepath.
I don't mind adding this in, but I think we did discuss this same concept when we did "config --show-origin", and ended up showing the whole path, to help with a few cases:
  - you know you're getting a value from the "system" config, but you
    don't know where that is (e.g., because the baked-in sysconfdir path
    is something you didn't expect)
  - you're in a scope like "global", but the value actually comes from
    an included file

Of course there's a flip-side, which is that showing "/etc/gitconfig" doesn't tell you that this is the "--system" file; the user has to infer that themselves.

There are no callers added here, so I'm not sure exactly how the new function is meant to be used. But I'd caution that it might be worth showing the scope _and_ the path, instead of one or the other.
-Peff
Just to mention, that I am working on submitting a feature to expand config with a --show-scope option via gitgitgadget.  I still have some kinks to iron out before it's ready for submission, but maybe it would make sense to wait for that? Or to wait for the rest of the patches this was taken from to actually materialize?
Previous: Jeff KingNext: Jeff King
Message 4 of 7 in “config: add string mapping for enum config_scope”
  1. config: add string mapping for enum config_scopeEmily Shaffer, Dec 11, 2019
  2. Matt RogersDec 11, 2019
  3. Jeff KingDec 12, 2019
  4. mattr94@gmail.comDec 12, 2019
  5. Jeff KingDec 12, 2019
  6. Emily ShafferDec 12, 2019
  7. Jeff KingDec 12, 2019

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.