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

[RFC/PATCH 0/2] Introduce safe-include config feature

From
Rasmus Villemoes <rv@rasmusvillemoes.dk>
Date
Oct 3, 2014, 01:37 UTC
Message-ID
<1412300254-11281-1-git-send-email-rv@rasmusvillemoes.dk>
In-Reply-To
<xmqqy4t7a5vx.fsf@gitster.dls.corp.google.com>
[trimming Ccs]

This is an attempt at implementing the suggested safe-include config feature. It mostly has the semantics Junio suggested in the parent post, but it does not directly extend the current include directive; instead, it uses a separate safe-include directive. This is done so that if a repository is used with both old and new versions of git, the older versions will just silently ignore the safe-include, instead of ignoring include.safe and then proceeding to processing "path = ../project.gitconfig".

Config variables are whitelisted using safe-include.whitelist; the value is interpreted as a whitespace-separated list of, possibly negated, patterns. Later patterns override earlier ones.

If the feature is deemed worthwhile and my approach is acceptable, I'll go ahead and try to write some documentation. For now, there is just a small test script.

Rasmus Villemoes (2):
  config: Add safe-include directive
  config: Add test of safe-include feature
 config.c                       | 91 +++++++++++++++++++++++++++++++++++++--
 t/t1309-config-safe-include.sh | 96 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 184 insertions(+), 3 deletions(-)
 create mode 100755 t/t1309-config-safe-include.sh
-- 
2.0.4
Previous: Junio C HamanoNext: Rasmus Villemoes
Message 7 of 14 in “project wide: git config entry for [diff] renames=true”
  1. Joe PerchesSep 25, 2014
  2. Jeff KingSep 25, 2014
  3. Joe PerchesSep 25, 2014
  4. Junio C HamanoSep 25, 2014
  5. Junio C HamanoSep 25, 2014
  6. Junio C HamanoSep 25, 2014
  7. 0/2 Introduce safe-include config featureRasmus Villemoes, Oct 3, 2014
  8. 1/2 config: Add safe-include directiveRasmus Villemoes, Oct 3, 2014
  9. Junio C HamanoOct 3, 2014
  10. Junio C HamanoOct 3, 2014
  11. Junio C HamanoOct 3, 2014
  12. Rasmus VillemoesOct 6, 2014
  13. Junio C HamanoOct 6, 2014
  14. 2/2 config: Add test of safe-include featureRasmus Villemoes, Oct 3, 2014

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.