Re: [PATCH 8/8] hook-list.h: add a generated list of hooks, like config-list.h
- From
René Scharfe <l.s.r@web.de>
- Date
- Sep 24, 2021, 16:39 UTC
- Message-ID
- <d5f297d4-9c64-1ff9-8422-054979bf8cfa@web.de>
- In-Reply-To
- <xmqqr1devuoc.fsf@gitster.g>
Am 24.09.21 um 17:51 schrieb Junio C Hamano:
Show 12 quoted lines
> Phillip Wood <phillip.wood123@gmail.com> writes:
>
>>> +sed -n -e '/^~~~~*$/ {x; s/^.*$/ "&",/; p;}; x' \
>>
>> POSIX does not support using a semicolon after a closing brace [1],
>> ...
>> [1] "Editing commands other that {...}, a, b, c, i, r, t, w, : and #
>> can be followed by a <semicolon>" from
>> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html
>
> Would sed implementation of BSD ancestry fail reliably to be a good
> coalmine canary?I doubt it. https://man.openbsd.org/sed says:
"Multiple commands may be specified separated by newlines or
semicolons" "The a, c, i, r, and w functions cannot be followed by another
command separated with a semicolon." "Following the b, t, or : commands with a semicolon and another
command is an extension to the specification." "The use of newlines to separate multiple commands on the command
line is non-portable"https://www.freebsd.org/cgi/man.cgi?query=sed doesn't mention semicolons at all.
On macOS 11.6 (FreeBSD-based userland) the semicolon is accepted:
$ echo a | sed -n -e '{p;}; p'
a
aRené