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

Re: [PATCH v2 1/1] config: learn the --stdin option for instructions

From
Jeff King <peff@peff.net>
Date
Jan 28, 2020, 09:24 UTC
Message-ID
<20200128092414.GB574544@coredump.intra.peff.net>
In-Reply-To
<CAPig+cS03oS9PhN_cusjpzoCzwNmgc5rXiVAmG3ceUCFw71PVg@mail.gmail.com>
On Mon, Jan 27, 2020 at 11:59:03AM -0500, Eric Sunshine wrote:
Show 18 quoted lines
> Second, this doesn't give any indication about how the lines should be
> terminated. It should instead be written as:
> 
>     set SP <key> NUL <value> NUL
>     unset SP <key> NUL
> 
> Third, importantly, unlike git-update-ref from which this DSL takes
> inspiration and in which "refs" might have oddball names for which
> NUL-termination makes sense, it's hard to imagine a case in which a
> configuration key would be so strange as to warrant NUL-termination.
> This observation suggests a simpler DSL in which only <value> is
> NUL-terminated:
> 
>     set SP <key> SP <value> NUL
>     unset SP <key> LF
> 
> (The proposed code changes in config.c would need adjustment, as well,
> to implement this revised DSL.)

The section and key parts of a config key are pretty restricted, but the subsection portion can contain anything except newline and NUL. So in particular, it would be valid to have a space, which would make the input ambiguous.

I agree it would probably be rare, but isn't the whole point of "-z" to be able to represent anything without worrying about quoting?

-Peff
Previous: Eric SunshineNext: Eric Sunshine
Message 5 of 9 in “config: read instructions from stdin”
  1. 0/1 config: read instructions from stdinZeger-Jan van de Weg, Jan 27, 2020
  2. 1/1 config: learn the --stdin option for instructionsZeger-Jan van de Weg, Jan 27, 2020
  3. Christian CouderJan 27, 2020
  4. Eric SunshineJan 27, 2020
  5. Jeff KingJan 28, 2020
  6. Eric SunshineJan 28, 2020
  7. Junio C HamanoJan 28, 2020
  8. Jeff KingJan 29, 2020
  9. Jeff KingJan 28, 2020

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.