git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "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>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 0/3] Add a generated list of hooks in hook-list.h
Date: Thu, 17 Jun 2021 12:09:33 +0200	[thread overview]
Message-ID: <cover-0.3-0000000000-20210617T100239Z-avarab@gmail.com> (raw)

This goes on top of my just-submitted trivial Makefile fixes[1], and
adds a list of hooks in hook-list.h, similar to the existing
config-list.h.

We can then error when a C API provides us with an unknown hook, so
non-type-checked things in the codebase like find_hook("proc-receive")
now effectively have a type check of sorts (well, we'd catch a typo in
our tests).

These changes are currently at the end of the
ab/config-based-hooks-base series[2], I'm carving them out to make
that topic even easier to digest. We can this without any of the "git
hook run" stuff.

We also had a big but inaccurate list of hooks in builtin/help.c, as
part of submitting a bugreport. That's now using githooks(5) as a
source of truth.

This also builds on Windows with cmake, unlike the outstanding [2]
`restart of "config-based-hooks"` series, at least that part of the CI
now passes, and the change to contrib/buildsystems/CMakeLists.txt
looks trivially correct to me.

1. https://lore.kernel.org/git/cover-0.3-0000000000-20210617T095827Z-avarab@gmail.com/
2. https://lore.kernel.org/git/cover-00.30-00000000000-20210614T101920Z-avarab@gmail.com/

Emily Shaffer (1):
  hook.c: add a hook_exists() wrapper and use it in bugreport.c

Ævar Arnfjörð Bjarmason (2):
  hook.[ch]: move find_hook() to this new library
  hook-list.h: add a generated list of hooks, like config-list.h

 .gitignore                          |  1 +
 Makefile                            | 12 +++++-
 builtin/am.c                        |  1 +
 builtin/bugreport.c                 | 46 +++++-----------------
 builtin/commit.c                    |  1 +
 builtin/merge.c                     |  1 +
 builtin/receive-pack.c              |  1 +
 builtin/worktree.c                  |  1 +
 contrib/buildsystems/CMakeLists.txt |  7 ++++
 generate-hooklist.sh                | 24 ++++++++++++
 hook.c                              | 61 +++++++++++++++++++++++++++++
 hook.h                              | 16 ++++++++
 refs.c                              |  1 +
 run-command.c                       | 35 +----------------
 run-command.h                       |  7 ----
 sequencer.c                         |  1 +
 transport.c                         |  1 +
 17 files changed, 138 insertions(+), 79 deletions(-)
 create mode 100755 generate-hooklist.sh
 create mode 100644 hook.c
 create mode 100644 hook.h

-- 
2.32.0.576.g59759b6ca7d


             reply	other threads:[~2021-06-17 10:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17 10:09 Ævar Arnfjörð Bjarmason [this message]
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
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=cover-0.3-0000000000-20210617T100239Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --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).