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

Re: [PATCH 2/2] config: add include directive

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 6, 2012, 22:39 UTC
Message-ID
<7v62fj60ya.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120206095404.GB4300@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> +Includes
> +~~~~~~~~
> +
> +You can include one config file from another by setting the special
> +`include.path` variable to the name of the file to be included. The
> +included file is expanded immediately, as if its contents had been
> +found at the location of the include directive. If the value of the
> +`include.path` variable is a relative path, the path is considered to be
> +relative to the configuration file in which the include directive was
> +found. See below for examples.

If the file referenced by this directive does not exist, what should happen? Should it be signalled as an error? Should it stop the whole calling process with die()?

I think "die() when we are honoring the include, ignore when we are not" would be a good way to handle this, as it allows us to catch mistakes while allowing the user to fix broken configuration files using "git config --unset include.path", but I may be overlooking something.

Previous: Jeff KingNext: Jeff King
Message 15 of 16 in “config includes 3: revenge of the killer includes”
  1. 0/2 config includes 3: revenge of the killer includesJeff King, Feb 6, 2012
  2. 1/2 docs: add a basic description of the config APIJeff King, Feb 6, 2012
  3. Junio C HamanoFeb 6, 2012
  4. Jeff KingFeb 7, 2012
  5. Jeff KingFeb 7, 2012
  6. Junio C HamanoFeb 7, 2012
  7. Junio C HamanoFeb 7, 2012
  8. Nguyen Thai Ngoc DuyFeb 8, 2012
  9. Junio C HamanoFeb 8, 2012
  10. Nguyen Thai Ngoc DuyFeb 8, 2012
  11. Jeff KingFeb 8, 2012
  12. Jeff KingFeb 8, 2012
  13. Jeff KingFeb 7, 2012
  14. 2/2 config: add include directiveJeff King, Feb 6, 2012
  15. Junio C HamanoFeb 6, 2012
  16. Jeff KingFeb 7, 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.