Re: git: accfb4cc9346 - main - genoffset.sh: stop using a temporary file

From: Jonathan T. Looney <jtl_at_freebsd.org>
Date: Thu, 16 Nov 2023 17:59:41 UTC
On Thu, Nov 16, 2023 at 11:23 AM Warner Losh <imp@bsdimp.com> wrote:

>
>
> On Thu, Nov 16, 2023 at 9:07 AM Jessica Clarke <jrtc27@freebsd.org> wrote:
>
>> On 16 Nov 2023, at 15:07, Jonathan T. Looney <jtl@FreeBSD.org> wrote:
>>
>> > -    cat "$temp/asserts"
>> > +    echo -e "${asserts}\c"
>>
>> This isn’t POSIX, and isn’t supported by macOS’s sh, so breaks the
>> build there. Please fix or revert promptly.
>>
>
> echo "${asserts}"
>
> is semantically the same for C. A stray newline doesn't matter in this
> context. It's not worth the effort to remove it.
>
> Sadly, echo -n doesn't work (it's not posix, and posix defines it
> specifically as implementation defined). `echo "fred\c"' works on macos,
> but not FreeBSD's shell echo built-in (but somehow does for /bin/echo).
> macos doesn't implement -e at all (it's also not posix). FreeBSD's shell
> echo build-in is not posix compliant. So, to be portable, just echo it, and
> cope with the extra newline.
>
> That's what I'd do :)
>

Thanks for the report and suggestions. I've committed a fix
in 884eeff20ce9. Please let me know if there are further concerns which I
should address.

Jonathan