From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Emily Shaffer <emilyshaffer@google.com>,
Jeff Hostetler <jeffhost@microsoft.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Felipe Contreras <felipe.contreras@gmail.com>
Subject: Re: [PATCH 3/3] hook-list.h: add a generated list of hooks, like config-list.h
Date: Fri, 18 Jun 2021 19:05:50 +0200 [thread overview]
Message-ID: <20210618170550.GE6312@szeder.dev> (raw)
In-Reply-To: <patch-3.3-f343fc7ae6-20210617T100239Z-avarab@gmail.com>
On Thu, Jun 17, 2021 at 12:09:36PM +0200, Ævar Arnfjörð Bjarmason wrote:
> diff --git a/generate-hooklist.sh b/generate-hooklist.sh
> new file mode 100755
> index 0000000000..5a3f7f849c
> --- /dev/null
> +++ b/generate-hooklist.sh
> @@ -0,0 +1,24 @@
> +#!/bin/sh
> +
> +echo "/* Automatically generated by generate-hooklist.sh */"
> +
> +print_hook_list () {
> + cat <<EOF
> +static const char *hook_name_list[] = {
> +EOF
> + perl -ne '
Why Perl?
At the moment I can run 'make' and get a functioning git even when
Perl is not installed. With this patch that wouldn't work anymore.
Both 'generate-cmdlist.sh' and 'generate-configlist.sh' can process
the documentation into a header file with a long list in it without
resorting to Perl; I'm sure that hooks could be processed without Perl
as well.
> + chomp;
> + @l[$.] = $_;
> + push @h => $l[$. - 1] if /^~~~+$/s;
> + END {
> + print qq[\t"$_",\n] for sort @h;
> + }
> + ' <Documentation/githooks.txt
> + cat <<EOF
> + NULL,
> +};
> +EOF
> +}
> +
> +echo
> +print_hook_list
next prev parent reply other threads:[~2021-06-18 17:05 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-17 10:09 [PATCH 0/3] Add a generated list of hooks in hook-list.h Ævar Arnfjörð Bjarmason
2021-06-17 10:09 ` [PATCH 1/3] hook.[ch]: move find_hook() to this new library Ævar Arnfjörð Bjarmason
2021-06-17 10:09 ` [PATCH 2/3] hook.c: add a hook_exists() wrapper and use it in bugreport.c Ævar Arnfjörð Bjarmason
2021-06-17 10:09 ` [PATCH 3/3] hook-list.h: add a generated list of hooks, like config-list.h Ævar Arnfjörð Bjarmason
2021-06-18 17:05 ` SZEDER Gábor [this message]
2021-06-18 17:50 ` Eric Sunshine
2021-06-19 6:06 ` Junio C Hamano
2021-06-20 13:53 ` Ævar Arnfjörð Bjarmason
2021-06-20 12:53 ` René Scharfe
2021-06-22 22:32 ` Johannes Schindelin
2021-06-29 0:32 ` Junio C Hamano
2021-06-29 17:53 ` René Scharfe
2021-06-29 18:53 ` [PATCH v2 0/3] Add a generated list of hooks in hook-list.h Ævar Arnfjörð Bjarmason
2021-06-29 18:54 ` [PATCH v2 1/3] hook.[ch]: move find_hook() to this new library Ævar Arnfjörð Bjarmason
2021-06-29 18:54 ` [PATCH v2 2/3] hook.c: add a hook_exists() wrapper and use it in bugreport.c Ævar Arnfjörð Bjarmason
2021-06-29 18:54 ` [PATCH v2 3/3] hook-list.h: add a generated list of hooks, like config-list.h Ævar Arnfjörð Bjarmason
2021-06-29 19:45 ` René Scharfe
2021-06-29 22:09 ` Ævar Arnfjörð Bjarmason
2021-07-09 20:29 ` Emily Shaffer
2021-07-10 9:03 ` Ævar Arnfjörð Bjarmason
2021-07-12 20:55 ` Emily Shaffer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210618170550.GE6312@szeder.dev \
--to=szeder.dev@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=avarab@gmail.com \
--cc=emilyshaffer@google.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jeffhost@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).