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

Re: Confused about git-config's description of escaping

From
Kyle Meyer <kyle@kyleam.com>
Date
Aug 3, 2020, 20:58 UTC
Message-ID
<874kpjwinx.fsf@kyleam.com>
In-Reply-To
<xmqqd047v62u.fsf@gitster.c.googlers.com>
Junio C Hamano writes:
> Kyle Meyer <kyle@kyleam.com> writes:
[...]
Show 7 quoted lines
>> What's gained by specifying "Inside double quotes"?  Are there any cases
>> where a value, whether enclosed in double quotes or not, doesn't need "
>> or \ characters escaped?
>
> Perhaps there is another description missing, either from the
> written docs or from your reading of it, that says that a value with
> these characters must be enclosed in double quotes pair?
Thanks for the reply.

I'm not spotting anything in the current git-config documentation that says that. And it would be an incorrect description of the syntax, wouldn't it? When entering a value containing a quote with 'git config', enclosing double quotes aren't inserted:

    $ git config a.b 'c"d'
    $ tail -n2 .git/config
    [a]
    	b = c\"d
    $ git config a.b
    c"d

So, it seems valid for a value to have these characters escaped without having them enclosed in a pair of double quotes.

Previous: Junio C Hamano
Message 3 of 3 in “Confused about git-config's description of escaping”
  1. Kyle MeyerAug 3, 2020
  2. Junio C HamanoAug 3, 2020
  3. Kyle MeyerAug 3, 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.