All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Kyle Meyer <kyle@kyleam.com>
Cc: git@vger.kernel.org
Subject: Re: Confused about git-config's description of escaping
Date: Mon, 03 Aug 2020 13:15:53 -0700	[thread overview]
Message-ID: <xmqqd047v62u.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <878sevwn0g.fsf@kyleam.com> (Kyle Meyer's message of "Mon, 03 Aug 2020 15:24:47 -0400")

Kyle Meyer <kyle@kyleam.com> writes:

> When describing the configuration syntax, the git-config manpage says
> this about the value:
>
>     Inside double quotes, double quote " and backslash \ characters must
>     be escaped: use \" for " and \\ for \.
>
> I find the "Inside double quotes" part confusing because escaping these
> characters appears to also be needed when there are no enclosing double
> quotes:
>
>     $ nl .git/config | tail -n2
>          6	[a]
>          7		b = c"d
>
>     $ git config a.b
>     fatal: bad config line 7 in file .git/config
>
>     $ git version
>     git version 2.28.0.236.gb10cc79966
>
> I was going to suggest dropping the "Inside double quotes" qualifier.
> Perhaps
>
>     Double quote " and backslash \ characters in the value must
>     be escaped: use \" for " and \\ for \.
>
> But it looks like that's pretty close to how this sentence was written
> before ff5507ed2a (Documentation/config.txt: describe the structure
> first and then meaning, 2015-03-04), which makes me think that I'm
> misreading the description or otherwise missing something.
>
> 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?


  reply	other threads:[~2020-08-03 20:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-03 19:24 Confused about git-config's description of escaping Kyle Meyer
2020-08-03 20:15 ` Junio C Hamano [this message]
2020-08-03 20:58   ` Kyle Meyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqd047v62u.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=kyle@kyleam.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.