Git development
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: git@vger.kernel.org, Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: [PATCH 1/2] t: work around multibyte bug in quoted heredocs with Dash v0.5.13
Date: Thu, 2 Apr 2026 07:44:53 +0200	[thread overview]
Message-ID: <ac4CVegAlxdf0zHq@pks.im> (raw)
In-Reply-To: <CAPig+cQHUk5abmc+CeJ0tPWs5z7XMq9AxHKZRdvEgULF4zTg0g@mail.gmail.com>

On Wed, Apr 01, 2026 at 12:21:41PM -0400, Eric Sunshine wrote:
> On Wed, Apr 1, 2026 at 6:59 AM Patrick Steinhardt <ps@pks.im> wrote:
> > When executing our test suite with Dash v0.5.13.2 one can observe
> > several test failures that all have the same symptoms: we have a quoted
> > heredoc that contains multibyte characters, but the final data does not
> > match what we actually wanted to write. One such example is in t0300,
> > where we see the diffs like the following:
> > [...]
> > For now, work around the bug by using unquoted heredocs instead.
> >
> > Signed-off-by: Patrick Steinhardt <ps@pks.im>
> > ---
> > diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh
> > @@ -675,7 +675,7 @@ test_expect_success 'match percent-encoded values' '
> >  test_expect_success 'match percent-encoded UTF-8 values in path' '
> >         test_config credential.https://example.com.useHttpPath true &&
> >         test_config credential.https://example.com/perú.git.helper "$HELPER" &&
> > -       check fill <<-\EOF
> > +       check fill <<-EOF
> >         url=https://example.com/per%C3%BA.git
> 
> Oof, this is the sort of change which cries out for an in-code
> comment, since we can't expect that future reviewers will remember
> this specific workaround in this specific script, and we can't expect
> that people working on this code will think to check the history to
> learn why the heredoc is unquoted. Without such a comment, someone
> working on this file for some purpose or another (or even a GSoC
> applicant looking for a microproject) will come along and "modernize"
> this script by adding back the heredoc quoting which this patch
> removes.
> 
> To prevent someone from "breaking" your "fix", at minimum, please add
> an explanatory comment somewhere near the top of the script which
> pretty much duplicates the information from the commit message:
> 
>     # *DONTQUOTE*: ...explanation of dash bug ...
> 
> and reference that comment at each location you "fix":
> 
>     # NOTE: Don't quote heredoc; see *DONTQUOTE* above.
>     check fill <<-EOF
>     ...

True indeed. I'll just add a short comment to the individual callsites.
Thanks!

Patrick

  reply	other threads:[~2026-04-02  5:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-01 10:42 [PATCH 0/2] t: work around bugs in Dash v0.5.13 Patrick Steinhardt
2026-04-01 10:42 ` [PATCH 1/2] t: work around multibyte bug in quoted heredocs with " Patrick Steinhardt
2026-04-01 16:21   ` Eric Sunshine
2026-04-02  5:44     ` Patrick Steinhardt [this message]
2026-04-01 10:42 ` [PATCH 2/2] t9300: work around partial read bug in " Patrick Steinhardt
2026-04-02  6:51 ` [PATCH v2 0/2] t: work around bugs " Patrick Steinhardt
2026-04-02  6:51   ` [PATCH v2 1/2] t: work around multibyte bug in quoted heredocs with " Patrick Steinhardt
2026-05-07  5:57     ` [PATCH] parser: Fix multi-byte output in here-doc with quoted delimiter Herbert Xu
2026-05-07  7:37       ` Herbert Xu
2026-04-02  6:51   ` [PATCH v2 2/2] t9300: work around partial read bug in Dash v0.5.13 Patrick Steinhardt

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=ac4CVegAlxdf0zHq@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --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