Re: [PATCH 2/4] doc: allow literal and emphasis format in doc vs help tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 28, 2024 at 6:07 AM Jeff King <peff@xxxxxxxx> wrote:
> On Sun, Mar 24, 2024 at 10:18:57PM +0000, Jean-Noël Avila via GitGitGadget wrote:
> > +                     s/{empty}\|_\|`//g;
>
> It looks like this doesn't work in the macos CI jobs. E.g., this run:
>
> I think the issue is that "|" alternation is not portable. In GNU sed,
> doing "\|" with BRE is enough, but in BSD sed you need to enable ERE
> with "-E". I'm not sure how portable that is (we do seem to have at
> least one instance in t6030, so maybe it's OK). The most basic
> alternative is just splitting it like:

After reading a patch very recently which used `sed -E`, but before
responding that it was not portable and wouldn't work on macOS, I did
a bit of research and was surprised to find that it is POSIX, and that
(at least) relatively recent macOS does support it. I recall that I
also spotted the existing instance in t6030, thus didn't respond after
all.

>   s/{empty}//g;
>   s/[_`]//g;

That said, I'm not sure how recently macOS started supporting `sed
-E`, so what you propose here may be a good idea anyhow; and it's
certainly going to be more portable done this way.





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux