Subject: Re: [PATCH 1/2] t: work around multibyte bug in quoted heredocs with Dash v0.5.13

From: Patrick Steinhardt <[email-masked]>
Date: Thu, 2 Apr 2026 07:44:53 +0200

On Wed, Apr 01, 2026 at 12:21:41PM -0400, Eric Sunshine wrote:
> On Wed, Apr 1, 2026 at 6:59 AM Patrick Steinhardt <[email-masked]> 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 <[email-masked]>
> > ---
> > 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