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

Re: [PATCH v2 2/2] config: Add hashtable for config parsing & retrieval

From
Jeff King <peff@peff.net>
Date
Jun 17, 2014, 05:46 UTC
Message-ID
<20140617054645.GD29957@sigill.intra.peff.net>
In-Reply-To
<20140617053436.GB29957@sigill.intra.peff.net>
On Tue, Jun 17, 2014 at 01:34:36AM -0400, Jeff King wrote:
Show 10 quoted lines
> You need some mechanism to store entries that are NULL. It may be enough
> to silently convert them into the string "true" inside the cached
> storage. But there may be callers who treat NULL specially (e.g., a
> tri-state true/false/auto that treats a bare boolean as "auto"); you'd
> need to check.
> 
> The other alternative is to use something besides string_list that can
> handle a NULL.  You may also need to give some thought to how such NULLs
> would be handled by git_config_get_string() (since a NULL there also
> means "not found").

After reading your other patch and thinking about config_error_nonbool, I don't think it would be right to silently convert this to "true".

E.g., imagine config like:
  [alias]
  foo

If we interpret alias.foo as a boolean, it means "true". But since alias.* variables are not booleans, the current alias code will produce an error (with config_error_nonbool). Silently converting it to true in the config layer would mean the alias code sees only "true", and rather than generating an error, it would run the command "true".

-Peff
Previous: Jeff King
Message 11 of 11 in “Git config cache & special querying api utilizing the cache”
  1. 0/2 Git config cache & special querying api utilizing the cacheTanay Abhra, Jun 16, 2014
  2. 1/2 string-list: Add string_list initializer helper functionsTanay Abhra, Jun 16, 2014
  3. Junio C HamanoJun 16, 2014
  4. Tanay AbhraJun 17, 2014
  5. Junio C HamanoJun 17, 2014
  6. 2/2 config: Add hashtable for config parsing & retrievalTanay Abhra, Jun 16, 2014
  7. Matthieu MoyJun 16, 2014
  8. Tanay AbhraJun 16, 2014
  9. Matthieu MoyJun 16, 2014
  10. Jeff KingJun 17, 2014
  11. Jeff KingJun 17, 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.