From: René Scharfe Date: Tue, 29 Jun 2021 17:53:55 GMT Subject: Re: [PATCH 3/3] hook-list.h: add a generated list of hooks, like config-list.h Message-ID: <20b1bfb6-8881-2a21-1753-0e2e508a7861@web.de> In-Reply-To: Am 29.06.21 um 02:32 schrieb Junio C Hamano: > Johannes Schindelin writes: > >> On Sun, 20 Jun 2021, René Scharfe wrote: >> >>> How about something like this? >>> >>> sed -n '/^~~~~*$/ {x; p;}; x' Documentation/githooks.txt | >>> sort | >>> sed 's/^.*$/ "&",/' >>> >>> sed is already used by generate-configlist.sh. >> >> I do like me a good sed script. >> >> Thanks, >> Dscho > > Yup. > > This is buried below the 27-patch series, so the whole thing cannot > advance until this gets sorted out. If it helps: You can add the patch below as number 28 or squash it in. --- >8 --- Subject: [PATCH] generate-hooklist.sh: use sed instead of Perl Allow hooklist.h to be built without Perl by finding, sorting and formatting hook names using two short sed(1) scripts and sort(1). Signed-off-by: René Scharfe --- generate-hooklist.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/generate-hooklist.sh b/generate-hooklist.sh index 5a3f7f849c..6f3de0a2ec 100755 --- a/generate-hooklist.sh +++ b/generate-hooklist.sh @@ -6,14 +6,9 @@ print_hook_list () { cat < $l[$. - 1] if /^~~~+$/s; - END { - print qq[\t"$_",\n] for sort @h; - } - '