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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 7, 2012, 18:03 UTC
Message-ID
<7vpqdq1pxt.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120207173025.GA22225@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> So fundamentally, includes make the idea of "overwrite this value" much
> more complex.

I do not think it is anything new that include.path brings. To give the user a complete view of "what customization applies when working in this repository?", and to allow the user to edit variables in the right file among usual three places, the tool already needs to be aware of possible places and give users a way to tell where the edit needs to go anyway. include.path only adds one more thing for the tool to be aware of.

With your example, the editor can show
	git config -f .git/config --list

with "include.path=~/.gitident" listed as one of the key=value pairs without showing key=value pairs included from that file. Or it can show user.name in effect is this value from .git/config, and optionally also show that there are other definitions of user.name in ~/.gitconfig (which we use as if we have "include.path=~/.gitconfig" at the top of .git/config file) or ~/.gitident specified with include.path.

The tool needs to make it easy to jump to ~/.gitident; it needs to know what include.path means. The user can edit the value in ~/.gitident, or after looking at ~/.gitident, choose to come back to .git/config and add an overriding entry there.

> But isn't "git cola" a git-config editing program?

Yes, that is really the right "rhetorical" question to ask. It needs to know what it is editing, so it at least needs to be _aware_ of the inclusion, where each item comes from, and how to edit contents of _one_ particular file.

And that issue is not something new that was introduced by include.path.
Previous: Jeff KingNext: Jeff King
Message 12 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.