git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Dragan Simic <dsimic@manjaro.org>
Cc: git@vger.kernel.org,  rsbecker@nexbridge.com,
	 github@seichter.de, sunshine@sunshineco.com
Subject: Re: [PATCH v3 4/4] config.txt: describe handling of whitespace further
Date: Wed, 20 Mar 2024 00:12:03 -0700	[thread overview]
Message-ID: <xmqqttl1js1o.fsf@gitster.g> (raw)
In-Reply-To: <e389acbfacd5046a926b87346d41f9c7962e3c23.1710800549.git.dsimic@manjaro.org> (Dragan Simic's message of "Mon, 18 Mar 2024 23:24:22 +0100")

Dragan Simic <dsimic@manjaro.org> writes:

>  A line that defines a value can be continued to the next line by
> +ending it with a `\`; the backslash and the end-of-line are stripped.
> +Leading whitespace characters after 'name =', the remainder of the
>  line after the first comment character '#' or ';', and trailing
> +whitespace characters of the line are discarded unless they are enclosed
> +in double quotes.

Can we directly tighten the "trailing..." part, instead of having to
add an extra long sentence ...

> +The discarding of the trailing whitespace characters
> +applies regardless of the discarding of the portion of the line after
> +the first comment character.

... like this as an attempt to clarify?

    Leading whitespace characters before and after 'name =', and the
    remainder of the line after the first comment character '#' or
    ';', are removed, and then trailing whitespace characters at the
    end of the line are discarded.

By the way, if a run of whitespace characters are enclosed in double
quotes, they cannot be trailing at the end of the line, as the
closing double quote is not a whitespace character, so it is out of
place to talk about quoted string in the context of trailing blank
removal.  The unquoting would want to be discussed separately.

> +Internal whitespace characters within the
> +value are retained verbatim.

Good.

>  
>  Inside double quotes, double quote `"` and backslash `\` characters
>  must be escaped: use `\"` for `"` and `\\` for `\`.

Thanks for working on this topic.

  reply	other threads:[~2024-03-20  7:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18 22:24 [PATCH v3 0/4] Fix a bug in configuration parsing, and improve tests and documentation Dragan Simic
2024-03-18 22:24 ` [PATCH v3 1/4] config: minor addition of whitespace Dragan Simic
2024-03-20  6:32   ` Junio C Hamano
2024-03-20  6:36     ` Dragan Simic
2024-03-18 22:24 ` [PATCH v3 2/4] config: really keep value-internal whitespace verbatim Dragan Simic
2024-03-18 22:24 ` [PATCH v3 3/4] t1300: add more tests for whitespace and inline comments Dragan Simic
2024-03-20  6:42   ` Junio C Hamano
2024-03-20  6:46     ` Dragan Simic
2024-03-20  6:59       ` Dragan Simic
2024-03-20 14:28         ` Junio C Hamano
2024-03-20 16:11           ` Dragan Simic
2024-03-18 22:24 ` [PATCH v3 4/4] config.txt: describe handling of whitespace further Dragan Simic
2024-03-20  7:12   ` Junio C Hamano [this message]
2024-03-20  7:23     ` Dragan Simic
2024-03-20 14:42       ` Junio C Hamano
2024-03-20 16:17         ` Dragan Simic

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=xmqqttl1js1o.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=dsimic@manjaro.org \
    --cc=git@vger.kernel.org \
    --cc=github@seichter.de \
    --cc=rsbecker@nexbridge.com \
    --cc=sunshine@sunshineco.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).