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

Re: [PATCH 0/2] config includes, take 2

From
Jeff King <peff@peff.net>
Date
Feb 9, 2012, 19:33 UTC
Message-ID
<20120209193314.GA19690@sigill.intra.peff.net>
In-Reply-To
<201202092024.43381.jnareb@gmail.com>
On Thu, Feb 09, 2012 at 08:24:42PM +0100, Jakub Narebski wrote:
Show 14 quoted lines
> > So the patch would look something like this. However, is the actual
> > filename really what callers want? It seems like in David's case, an
> > annotation of "repo", "global", or "system" (possibly in addition to the
> > filename) would be the most useful (because in the git-cola UI, it is
> > still nice to list things as "repo" or "global" instead of spewing the
> > whole filename at the user -- but you would still want the individual
> > filename for handling updates of includes).
> 
> I'm not sure if "system" / "global" / "local" or "repo" would be a good
> idea.
> 
> First, in the case of includes you would have to provide pathnames of
> included files.  This would introduce inconsistency.  Is "system"
> the '/etc/gitconfig' file, or 'system' file in '.git' directory?

Yeah, it would have to be syntactically unambiguous with the filename. I was thinking something of just including both, like this:

  global:/home/peff/.gitconfig<TAB>include.path=other-file
  global:/home/peff/other-file<TAB>some.key=value

That is, give a "context" (repo, global, system) to each lookup, and then mention the individual file as well (either because it is the root of that context, or because it was included). So a config editor could present the context to the user as a purely decorative thing (i.e., tell the user "these options affect all of your repos"), but use the filename to actually update the values (i.e., "git config -f /home/peff/other-file some.key newvalue").

Show 5 quoted lines
> Second, people can have different build configuration, e.g. the prefix
> might differ, so that "system" is not always '/etc/gitconfig'.  If you
> want to edit config you would want to know which file to edit... and though
> there is "git config --system --edit" it depends on having editor
> configured correctly.
Without includes, something like git-cola could possibly get away with:
  git config --system some.key value

but that doesn't work for included files; for those, you'd want to have the actual filename.

-Peff
Previous: Jakub Narebski
Message 19 of 19 in “config includes, take 2”
  1. 0/2 config includes, take 2Jeff King, Feb 6, 2012
  2. 1/2 imap-send: remove dead codeJeff King, Feb 6, 2012
  3. 2/2 config: add include directiveJeff King, Feb 6, 2012
  4. Junio C HamanoFeb 6, 2012
  5. Michael HaggertyFeb 6, 2012
  6. Jeff KingFeb 6, 2012
  7. Jeff KingFeb 6, 2012
  8. David AguilarFeb 7, 2012
  9. Jeff KingFeb 7, 2012
  10. David AguilarFeb 7, 2012
  11. Jeff KingFeb 7, 2012
  12. Junio C HamanoFeb 7, 2012
  13. Jeff KingFeb 7, 2012
  14. Jakub NarebskiFeb 7, 2012
  15. Jeff KingFeb 7, 2012
  16. David AguilarFeb 7, 2012
  17. Jeff KingFeb 9, 2012
  18. Jakub NarebskiFeb 9, 2012
  19. Jeff KingFeb 9, 2012

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.