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

Re: [PATCH v2] add a flag to supress errors in git_config_parse_key()

From
Jeff King <peff@peff.net>
Date
Feb 18, 2015, 19:02 UTC
Message-ID
<20150218190215.GD7257@peff.net>
In-Reply-To
<54E1A30F.5010303@gmail.com>
On Mon, Feb 16, 2015 at 01:28:07PM +0530, Tanay Abhra wrote:
Show 7 quoted lines
> I went through Junio's config guideline patch series
> and the whole thread of underscore bug report and I also think
> that pager.*.command is the right path to go.
> 
> If you want to relax the syntactic requirement (such as add '_' to
> the current set of allowed chacters), I can work upon it but most of the
> comments point that moving towards pager.*.command would be better.

No, as silly as I find the "_" restriction, it is not worth doing. One, it would not cover all cases (it is one common case, so it makes the problem more rare but does not eliminate it). And two, there are other parsers of git's config format. Technically we do not need to care about them and they can follow our lead, but we do not need to make things harder on them than is necessary.

>  	if (last_dot == NULL || last_dot == key) {
> -		error("key does not contain a section: %s", key);
> +		if (!flags)
> +			error("key does not contain a section: %s", key);
The intent of the flag variable is that you would check:
  if (!(flags & CONFIG_ERROR_QUIET))

here. I know that there are no other flags yet, so the two are equivalent. But when somebody adds a new flag later, you would not want them to have to tweak each of these sites.

-Peff
Previous: Tanay AbhraNext: Mikael Magnusson
Message 9 of 16 in “BUG: 'error: invalid key: pager.show_ref' on 'git show_ref'”
  1. Andreas KreyFeb 6, 2015
  2. Jeff KingFeb 6, 2015
  3. Junio C HamanoFeb 6, 2015
  4. Jeff KingFeb 6, 2015
  5. config: add show_err flag to git_config_parse_key()Tanay Abhra, Feb 10, 2015
  6. Jeff KingFeb 11, 2015
  7. Junio C HamanoFeb 11, 2015
  8. add a flag to supress errors in git_config_parse_key()Tanay Abhra, Feb 16, 2015
  9. Jeff KingFeb 18, 2015
  10. Mikael MagnussonFeb 7, 2015
  11. Jeff KingFeb 7, 2015
  12. Junio C HamanoFeb 6, 2015
  13. Jeff KingFeb 6, 2015
  14. Junio C HamanoFeb 6, 2015
  15. Junio C HamanoFeb 6, 2015
  16. Jeff KingFeb 7, 2015

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.