Re: [PATCH 8/8] hook-list.h: add a generated list of hooks, like config-list.h
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Sep 24, 2021, 10:19 UTC
- Message-ID
- <92471ff9-7573-c3e4-e9fd-63a5cbf5738f@gmail.com>
- In-Reply-To
- <patch-8.8-80aae4d5c13-20210923T095326Z-avarab@gmail.com>
Hi Ævar On 23/09/2021 11:30, Ævar Arnfjörð Bjarmason wrote:
Show 17 quoted lines
> diff --git a/generate-hooklist.sh b/generate-hooklist.sh
> new file mode 100755
> index 00000000000..6d4e56d1a31
> --- /dev/null
> +++ b/generate-hooklist.sh
> @@ -0,0 +1,18 @@
> +#!/bin/sh
> +#
> +# Usage: ./generate-hooklist.sh >hook-list.h
> +
> +cat <<EOF
> +/* Automatically generated by generate-hooklist.sh */
> +
> +static const char *hook_name_list[] = {
> +EOF
> +
> +sed -n -e '/^~~~~*$/ {x; s/^.*$/ "&",/; p;}; x' \POSIX does not support using a semicolon after a closing brace [1], grepping our code base with git grep 'sed .*};' '*.sh' does not give any matches so I don't think we're using that pattern any where else. Replacing the semicolon with ' -e' would fix it.
Best Wishes
Phillip
[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