On 02/10/2024 22:43, Eric Sunshine wrote:
On Wed, Oct 2, 2024 at 11:17 AM Patrick Steinhardt <ps@xxxxxx> wrote:
Two of our tests in t3404 use indented HERE docs where leading tabs on
some of the lines are actually relevant. The tabs do get removed though,
and we try to fix this up by using sed(1) to replace leading tabs in the
actual output, as well. But on macOS 10.15 this doesn't work as expected
and we somehow keep the tabs around in the actual output.
I presume this nebulous explanation is due to the fact that the reason
why macOS 10.15 exhibits this anomalous behavior is not yet known?
I suspect that the problem is that we use "\t" which is non-standard
rather than a literal tab character in the sed expression.
Although this works, the problem with this change (and its sibling
later in the patch) is that someday someone is going to come along
(say, for instance, a GSoC applicant doing a microproject) who submits
a patch to (re-)"modernize" this test by using `<<-` to (re-)indent
the heredoc body. A better approach would probably be to retain `<<-`
and use q_to_tab():
q_to_tab >expect <<-\EOF &&
Qrefs/heads/first
Q...
Qrefs/heads/third
EOF
I agree that using q_to_tab is a better approach here.
These first few patches all look like useful fixes in their own right. I
might be worth splitting them out into a separate series so they can
progress independently of the build system changes.
Best Wishes
Phillip