From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Git List" <git@vger.kernel.org>,
hsed@unimetic.com
Subject: Re: [PATCH] tests: avoid syntax triggering old dash bug
Date: Wed, 28 Nov 2018 13:45:59 +0900 [thread overview]
Message-ID: <xmqqo9a9stbs.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CAPig+cS-_m8RBsCME_Gj15EEs1tcFcGn0Acfvq4HgxKiL9PaHg@mail.gmail.com> (Eric Sunshine's message of "Tue, 27 Nov 2018 14:16:55 -0500")
Eric Sunshine <sunshine@sunshineco.com> writes:
> On Tue, Nov 27, 2018 at 11:43 AM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>> Avoid a bug in dash that's been fixed ever since its
>> ec2c84d ("[PARSER] Fix clobbering of checkkwd", 2011-03-15)[1] first
>> released with dash v0.5.7 in July 2011.
>
> Perhaps enhance the commit message to explain the nature of the bug
> itself. It is not at all obvious from reading the above or from
> looking at the diff itself what the actual problem is that the patch
> is fixing. (And it wasn't even immediately obvious by looking at the
> commit message of ec2c84d in the dash repository.) To help readers of
> this patch avoid re-introducing this problem or diagnose such a
> failure, it might be a good idea to give an example of the syntax
> which trips up old dash (i.e. a here-doc followed immediately by a
> {...} expression) and the actual error message 'Syntax error: "}"
> unexpected'.
Indeed. From the patch text, I would not have even guessed. I was
wondering if there were interactions with "" and $() inside it.
If having {...} immediately after a here-doc is a problem, then the
patch should not touch existing code at all, but instead insert a
new line, perhaps like
: avoid open brace immediately after here-doc for old dash
immediately before {...}; that would have made it easier to grok.
>@@ -892,8 +892,9 @@ test_expect_success 'get --expiry-date' '
> 1510348087
> 0
> EOF
>+ date_valid1=$(git config --expiry-date date.valid1) &&
> {
>- echo "$rel_out $(git config --expiry-date date.valid1)"
>+ echo "$rel_out $date_valid1"
> git config --expiry-date date.valid2 &&
> git config --expiry-date date.valid3 &&
> git config --expiry-date date.valid4 &&
next prev parent reply other threads:[~2018-11-28 4:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-27 16:42 [PATCH] tests: avoid syntax triggering old dash bug Ævar Arnfjörð Bjarmason
2018-11-27 19:16 ` Eric Sunshine
2018-11-27 19:37 ` Ævar Arnfjörð Bjarmason
2018-11-28 4:45 ` Junio C Hamano [this message]
2019-02-13 11:59 ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2019-02-13 21:43 ` Junio C Hamano
2019-02-13 21:48 ` SZEDER Gábor
2019-02-14 9:51 ` Ævar Arnfjörð Bjarmason
2018-11-28 1:47 ` [PATCH] " brian m. carlson
2018-11-28 7:06 ` Torsten Bögershausen
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqo9a9stbs.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=hsed@unimetic.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).