git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 00/13] hook.[ch]: new library to run hooks + simple hook conversion

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Oct 15, 2021, 09:43 UTC
Message-ID
<cover-v2-00.13-00000000000-20211015T093918Z-avarab@gmail.com>

Part 2 of the greater configurable hook saga, starting by converting some existing simple hooks to the new hook.[ch] library and "git hook run" utility.

See the v1 [1] CL for more context. I've dropped the git-p4 folks from the CC list, your feedback on git-p4 would still be very appreciated, but I don't think I need to re-spam you for every re-roll of this.

This v2:
 * Should address all outstanding comments on v1, which were mainly of
   the form that some boilerplate here didn't reflect the actual state
   of the code.
   I've updated the docs, code etc. to 1=1 map to the existing
   behavior. I said I'd punt on e.g. the one-member "struct hook" in
   reply to René Scharfe, but when I tried it and rebased the rest on
   it it actually made the progression more understandable, so I've
   done that here.
   I didn't convert some things, which are noted in the updated commit
   message on v1, e.g. we still use the parallel run-command.c API
   with jobs=1, and have a function called run_hooks() that only ever
   runs one hook.
1. https://lore.kernel.org/git/cover-00.13-00000000000-20211012T131934Z-avarab@gmail.com/
Emily Shaffer (12):
  hook: add 'run' subcommand
  gc: use hook library for pre-auto-gc hook
  rebase: convert pre-rebase to use hook.h
  am: convert applypatch to use hook.h
  hooks: convert 'post-checkout' hook to hook library
  merge: convert post-merge to use hook.h
  send-email: use 'git hook run' for 'sendemail-validate'
  git-p4: use 'git hook' to run hooks
  commit: convert {pre-commit,prepare-commit-msg} hook to hook.h
  read-cache: convert post-index-change to use hook.h
  receive-pack: convert push-to-checkout hook to hook.h
  run-command: remove old run_hook_{le,ve}() hook API
Ævar Arnfjörð Bjarmason (1):
  git hook run: add an --ignore-missing flag
 .gitignore                 |   1 +
 Documentation/git-hook.txt |  45 +++++++++++++
 Documentation/githooks.txt |   4 ++
 Makefile                   |   1 +
 builtin.h                  |   1 +
 builtin/am.c               |   8 ++-
 builtin/checkout.c         |  14 ++--
 builtin/clone.c            |   7 +-
 builtin/gc.c               |   3 +-
 builtin/hook.c             |  90 +++++++++++++++++++++++++
 builtin/merge.c            |   4 +-
 builtin/rebase.c           |   8 ++-
 builtin/receive-pack.c     |   7 +-
 builtin/worktree.c         |  28 ++++----
 command-list.txt           |   1 +
 commit.c                   |  15 +++--
 git-p4.py                  |  72 ++------------------
 git-send-email.perl        |  22 +++---
 git.c                      |   1 +
 hook.c                     | 121 +++++++++++++++++++++++++++++++++
 hook.h                     |  56 ++++++++++++++++
 read-cache.c               |  11 ++-
 reset.c                    |  14 ++--
 run-command.c              |  32 ---------
 run-command.h              |  17 -----
 t/t1800-hook.sh            | 134 +++++++++++++++++++++++++++++++++++++
 t/t9001-send-email.sh      |   4 +-
 27 files changed, 551 insertions(+), 170 deletions(-)
 create mode 100644 Documentation/git-hook.txt
 create mode 100644 builtin/hook.c
 create mode 100755 t/t1800-hook.sh
Range-diff against v1:
 1:  a39c0748d3f !  1:  ba64faf0580 hook: add 'run' subcommand
    @@ Commit message
         pattern here mirrors that of
         builtin/{commit-graph,multi-pack-index}.c.
     
    +    Some of the implementation here, such as a function being named
    +    run_hooks() when it's tasked with running one hook, to using the
    +    run_processes_parallel_tr2() API to run with jobs=1 is somewhere
    +    between a bit odd and and an overkill for the current features of this
    +    "hook run" command and the hook.[ch] API.
    +
    +    This code will eventually be able to run multiple hooks declared in
    +    config in parallel, by starting out with these names and APIs we
    +    reduce the later churn of renaming functions, switching from the
    +    run_command() to run_processes_parallel_tr2() API etc.
    +
         Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
     
    @@ Documentation/git-hook.txt (new)
     +
     +NAME
     +----
    -+git-hook - run git hooks
    ++git-hook - Run git hooks
     +
     +SYNOPSIS
     +--------
    @@ Documentation/git-hook.txt (new)
     +DESCRIPTION
     +-----------
     +
    -+This command is an interface to git hooks (see linkgit:githooks[5]).
    -+Currently it only provides a convenience wrapper for running hooks for
    -+use by git itself. In the future it might gain other functionality.
    ++A command interface to running git hooks (see linkgit:githooks[5]),
    ++for use by other scripted git commands.
     +
     +SUBCOMMANDS
     +-----------
     +
     +run::
     +	Run the `<hook-name>` hook. See linkgit:githooks[5] for
    -+	the hook names we support.
    ++	supported hook names.
     ++
    -+Any positional arguments to the hook should be passed after an
    -+optional `--` (or `--end-of-options`, see linkgit:gitcli[7]). The
    -+arguments (if any) differ by hook name, see linkgit:githooks[5] for
    -+what those are.
    ++
    ++Any positional arguments to the hook should be passed after a
    ++mandatory `--` (or `--end-of-options`, see linkgit:gitcli[7]). See
    ++linkgit:githooks[5] for arguments hooks might expect (if any).
     +
     +SEE ALSO
     +--------
    @@ builtin/hook.c (new)
     +	/* Need to take into account core.hooksPath */
     +	git_config(git_default_config, NULL);
     +
    -+	/*
    -+	 * We are not using a plain run_hooks() because we'd like to
    -+	 * detect missing hooks. Let's find it ourselves and call
    -+	 * run_hooks() instead.
    -+	 */
     +	hook_name = argv[0];
     +	hook_path = find_hook(hook_name);
     +	if (!hook_path) {
    @@ command-list.txt: git-grep                                mainporcelain
      git-gui                                 mainporcelain
      git-hash-object                         plumbingmanipulators
      git-help                                ancillaryinterrogators          complete
    -+git-hook                                mainporcelain
    ++git-hook                                purehelpers
      git-http-backend                        synchingrepositories
      git-http-fetch                          synchelpers
      git-http-push                           synchelpers
    @@ hook.c: int hook_exists(const char *name)
     +			  void **pp_task_cb)
     +{
     +	struct hook_cb_data *hook_cb = pp_cb;
    -+	struct hook *run_me = hook_cb->run_me;
    ++	const char *hook_path = hook_cb->hook_path;
     +
    -+	if (!run_me)
    ++	if (!hook_path)
     +		return 0;
     +
     +	cp->no_stdin = 1;
    @@ hook.c: int hook_exists(const char *name)
     +	cp->stdout_to_stderr = 1;
     +	cp->trace2_hook_name = hook_cb->hook_name;
     +
    -+	/* add command */
    -+	strvec_push(&cp->args, run_me->hook_path);
    -+
    -+	/*
    -+	 * add passed-in argv, without expanding - let the user get back
    -+	 * exactly what they put in
    -+	 */
    ++	strvec_push(&cp->args, hook_path);
     +	strvec_pushv(&cp->args, hook_cb->options->args.v);
     +
     +	/* Provide context for errors if necessary */
    -+	*pp_task_cb = run_me;
    ++	*pp_task_cb = (char *)hook_path;
     +
     +	/*
     +	 * This pick_next_hook() will be called again, we're only
     +	 * running one hook, so indicate that no more work will be
     +	 * done.
     +	 */
    -+	hook_cb->run_me = NULL;
    ++	hook_cb->hook_path = NULL;
     +
     +	return 1;
     +}
    @@ hook.c: int hook_exists(const char *name)
     +				void *pp_task_cp)
     +{
     +	struct hook_cb_data *hook_cb = pp_cb;
    -+	struct hook *attempted = pp_task_cp;
    ++	const char *hook_path = pp_task_cp;
     +
     +	hook_cb->rc |= 1;
     +
     +	strbuf_addf(out, _("Couldn't start hook '%s'\n"),
    -+		    attempted->hook_path);
    ++		    hook_path);
     +
     +	return 1;
     +}
    @@ hook.c: int hook_exists(const char *name)
     +int run_hooks(const char *hook_name, const char *hook_path,
     +	      struct run_hooks_opt *options)
     +{
    -+	struct hook my_hook = {
    -+		.hook_path = hook_path,
    -+	};
     +	struct hook_cb_data cb_data = {
     +		.rc = 0,
     +		.hook_name = hook_name,
    ++		.hook_path = hook_path,
     +		.options = options,
     +	};
     +	int jobs = 1;
    @@ hook.c: int hook_exists(const char *name)
     +	if (!options)
     +		BUG("a struct run_hooks_opt must be provided to run_hooks");
     +
    -+	cb_data.run_me = &my_hook;
    -+
     +	run_processes_parallel_tr2(jobs,
     +				   pick_next_hook,
     +				   notify_start_failure,
    @@ hook.h
      #define HOOK_H
     +#include "strvec.h"
     +
    -+struct hook {
    -+	/* The path to the hook */
    -+	const char *hook_path;
    -+};
    -+
     +struct run_hooks_opt
     +{
     +	/* Environment vars to be set for each hook */
    @@ hook.h
     +	/* rc reflects the cumulative failure state */
     +	int rc;
     +	const char *hook_name;
    -+	struct hook *run_me;
    ++	const char *hook_path;
     +	struct run_hooks_opt *options;
     +};
      
    @@ hook.h: const char *find_hook(const char *name);
      int hook_exists(const char *hookname);
      
     +/**
    -+ * Clear data from an initialized "struct run_hooks-opt".
    ++ * Clear data from an initialized "struct run_hooks_opt".
     + */
     +void run_hooks_opt_clear(struct run_hooks_opt *o);
     +
 2:  dbac4204f7b =  2:  e3dc0aed81b gc: use hook library for pre-auto-gc hook
 3:  ff306debcb8 =  3:  6227a1e644d rebase: convert pre-rebase to use hook.h
 4:  b1d529ca485 =  4:  0e34eb54054 am: convert applypatch to use hook.h
 5:  15d71fc210b !  5:  a4df96c1719 hooks: convert 'post-checkout' hook to hook library
    @@ hook.c: static int pick_next_hook(struct child_process *cp,
      	cp->trace2_hook_name = hook_cb->hook_name;
     +	cp->dir = hook_cb->options->dir;
      
    - 	/* add command */
    - 	strvec_push(&cp->args, run_me->hook_path);
    + 	strvec_push(&cp->args, hook_path);
    + 	strvec_pushv(&cp->args, hook_cb->options->args.v);
     @@ hook.c: static int notify_hook_finished(int result,
      int run_hooks(const char *hook_name, const char *hook_path,
      	      struct run_hooks_opt *options)
      {
     +	struct strbuf abs_path = STRBUF_INIT;
    - 	struct hook my_hook = {
    - 		.hook_path = hook_path,
    - 	};
    + 	struct hook_cb_data cb_data = {
    + 		.rc = 0,
    + 		.hook_name = hook_name,
     @@ hook.c: int run_hooks(const char *hook_name, const char *hook_path,
      	if (!options)
      		BUG("a struct run_hooks_opt must be provided to run_hooks");
      
     +	if (options->absolute_path) {
     +		strbuf_add_absolute_path(&abs_path, hook_path);
    -+		my_hook.hook_path = abs_path.buf;
    ++		hook_path = abs_path.buf;
     +	}
    - 	cb_data.run_me = &my_hook;
    - 
    ++
      	run_processes_parallel_tr2(jobs,
    + 				   pick_next_hook,
    + 				   notify_start_failure,
     @@ hook.c: int run_hooks(const char *hook_name, const char *hook_path,
      				   "hook",
      				   hook_name);
 6:  08f27f0d6be =  6:  327f916f8c3 merge: convert post-merge to use hook.h
 7:  107c14d740f !  7:  328767015b1 git hook run: add an --ignore-missing flag
    @@ Commit message
         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
     
      ## Documentation/git-hook.txt ##
    -@@ Documentation/git-hook.txt: git-hook - run git hooks
    +@@ Documentation/git-hook.txt: git-hook - Run git hooks
      SYNOPSIS
      --------
      [verse]
    @@ Documentation/git-hook.txt: git-hook - run git hooks
      
      DESCRIPTION
      -----------
    -@@ Documentation/git-hook.txt: optional `--` (or `--end-of-options`, see linkgit:gitcli[7]). The
    - arguments (if any) differ by hook name, see linkgit:githooks[5] for
    - what those are.
    +@@ Documentation/git-hook.txt: Any positional arguments to the hook should be passed after a
    + mandatory `--` (or `--end-of-options`, see linkgit:gitcli[7]). See
    + linkgit:githooks[5] for arguments hooks might expect (if any).
      
     +OPTIONS
     +-------
    @@ builtin/hook.c: static int run(int argc, const char **argv, const char *prefix)
      	};
      	int ret;
     @@ builtin/hook.c: static int run(int argc, const char **argv, const char *prefix)
    - 	/*
    - 	 * We are not using a plain run_hooks() because we'd like to
    - 	 * detect missing hooks. Let's find it ourselves and call
    --	 * run_hooks() instead.
    -+	 * run_hooks() instead...
    - 	 */
    + 	git_config(git_default_config, NULL);
    + 
      	hook_name = argv[0];
     +	if (ignore_missing)
    -+		/* ... act like a plain run_hooks() under --ignore-missing */
     +		return run_hooks_oneshot(hook_name, &opt);
      	hook_path = find_hook(hook_name);
      	if (!hook_path) {
 8:  1d30e2dbbe0 =  8:  6c4ebd68d56 send-email: use 'git hook run' for 'sendemail-validate'
 9:  69cc447a1e1 =  9:  b1f52733e3c git-p4: use 'git hook' to run hooks
10:  1c22b2992cf = 10:  dc31d98acdf commit: convert {pre-commit,prepare-commit-msg} hook to hook.h
11:  e762fce32af = 11:  58b7689e4af read-cache: convert post-index-change to use hook.h
12:  d63b91196ae = 12:  ae1e2a82147 receive-pack: convert push-to-checkout hook to hook.h
13:  fe8996dda3e = 13:  289d5a2d849 run-command: remove old run_hook_{le,ve}() hook API
-- 
2.33.1.1338.g20da966911a
Next: Ævar Arnfjörð Bjarmason
Message 1 of 115 in “hook.[ch]: new library to run hooks + simple hook conversion”
  1. 00/13 hook.[ch]: new library to run hooks + simple hook conversionÆvar Arnfjörð Bjarmason, Oct 15, 2021
  2. 01/13 hook: add 'run' subcommandÆvar Arnfjörð Bjarmason, Oct 15, 2021
  3. Emily ShafferOct 15, 2021
  4. Eric SunshineOct 15, 2021
  5. Ævar Arnfjörð BjarmasonOct 19, 2021
  6. 02/13 gc: use hook library for pre-auto-gc hookÆvar Arnfjörð Bjarmason, Oct 15, 2021
  7. Emily ShafferOct 15, 2021
  8. 04/13 am: convert applypatch to use hook.hÆvar Arnfjörð Bjarmason, Oct 15, 2021
  9. Emily ShafferOct 15, 2021
  10. 05/13 hooks: convert 'post-checkout' hook to hook libraryÆvar Arnfjörð Bjarmason, Oct 15, 2021
  11. Emily ShafferOct 15, 2021
  12. 03/13 rebase: convert pre-rebase to use hook.hÆvar Arnfjörð Bjarmason, Oct 15, 2021
  13. Emily ShafferOct 15, 2021
  14. 06/13 merge: convert post-merge to use hook.hÆvar Arnfjörð Bjarmason, Oct 15, 2021
  15. Emily ShafferOct 15, 2021
  16. 07/13 git hook run: add an --ignore-missing flagÆvar Arnfjörð Bjarmason, Oct 15, 2021
  17. Emily ShafferOct 15, 2021
  18. 08/13 send-email: use 'git hook run' for 'sendemail-validate'Ævar Arnfjörð Bjarmason, Oct 15, 2021
  19. Emily ShafferOct 15, 2021
  20. 09/13 git-p4: use 'git hook' to run hooksÆvar Arnfjörð Bjarmason, Oct 15, 2021
  21. Emily ShafferOct 15, 2021
  22. 10/13 commit: convert {pre-commit,prepare-commit-msg} hook to hook.hÆvar Arnfjörð Bjarmason, Oct 15, 2021
  23. Emily ShafferOct 15, 2021
  24. 11/13 read-cache: convert post-index-change to use hook.hÆvar Arnfjörð Bjarmason, Oct 15, 2021
  25. Emily ShafferOct 15, 2021
  26. 12/13 receive-pack: convert push-to-checkout hook to hook.hÆvar Arnfjörð Bjarmason, Oct 15, 2021
  27. 13/13 run-command: remove old run_hook_{le,ve}() hook APIÆvar Arnfjörð Bjarmason, Oct 15, 2021
  28. Emily ShafferOct 15, 2021
  29. Emily ShafferOct 15, 2021
  30. Junio C HamanoOct 16, 2021
  31. Eric SunshineOct 16, 2021
  32. Ævar Arnfjörð BjarmasonOct 16, 2021
  33. Junio C HamanoOct 16, 2021
  34. Ævar Arnfjörð BjarmasonOct 16, 2021
  35. 00/13 hook.[ch]: new library to run hooks + simple hook conversionÆvar Arnfjörð Bjarmason, Oct 19, 2021
  36. 01/13 hook: add 'run' subcommandÆvar Arnfjörð Bjarmason, Oct 19, 2021
  37. 02/13 gc: use hook library for pre-auto-gc hookÆvar Arnfjörð Bjarmason, Oct 19, 2021
  38. 03/13 rebase: convert pre-rebase to use hook.hÆvar Arnfjörð Bjarmason, Oct 19, 2021
  39. Junio C HamanoOct 29, 2021
  40. 04/13 am: convert applypatch to use hook.hÆvar Arnfjörð Bjarmason, Oct 19, 2021
  41. 05/13 hooks: convert 'post-checkout' hook to hook libraryÆvar Arnfjörð Bjarmason, Oct 19, 2021
  42. Junio C HamanoOct 29, 2021
  43. 06/13 merge: convert post-merge to use hook.hÆvar Arnfjörð Bjarmason, Oct 19, 2021
  44. 07/13 git hook run: add an --ignore-missing flagÆvar Arnfjörð Bjarmason, Oct 19, 2021
  45. Junio C HamanoOct 29, 2021
  46. 08/13 send-email: use 'git hook run' for 'sendemail-validate'Ævar Arnfjörð Bjarmason, Oct 19, 2021
  47. 09/13 git-p4: use 'git hook' to run hooksÆvar Arnfjörð Bjarmason, Oct 19, 2021
  48. 10/13 commit: convert {pre-commit,prepare-commit-msg} hook to hook.hÆvar Arnfjörð Bjarmason, Oct 19, 2021
  49. 11/13 read-cache: convert post-index-change to use hook.hÆvar Arnfjörð Bjarmason, Oct 19, 2021
  50. 12/13 receive-pack: convert push-to-checkout hook to hook.hÆvar Arnfjörð Bjarmason, Oct 19, 2021
  51. 13/13 run-command: remove old run_hook_{le,ve}() hook APIÆvar Arnfjörð Bjarmason, Oct 19, 2021
  52. Junio C HamanoOct 29, 2021
  53. 00/17 hook.[ch]: new library to run hooks + simple hook conversionÆvar Arnfjörð Bjarmason, Nov 1, 2021
  54. 02/17 hook API: add a run_hooks() wrapperÆvar Arnfjörð Bjarmason, Nov 1, 2021
  55. 09/17 hooks: convert non-worktree 'post-checkout' hook to hook libraryÆvar Arnfjörð Bjarmason, Nov 1, 2021
  56. 01/17 hook: add 'run' subcommandÆvar Arnfjörð Bjarmason, Nov 1, 2021
  57. 05/17 hook API: add a run_hooks_l() wrapperÆvar Arnfjörð Bjarmason, Nov 1, 2021
  58. 04/17 am: convert {pre,post}-applypatch to use hook.hÆvar Arnfjörð Bjarmason, Nov 1, 2021
  59. 03/17 gc: use hook library for pre-auto-gc hookÆvar Arnfjörð Bjarmason, Nov 1, 2021
  60. 07/17 am: convert applypatch-msg to use hook.hÆvar Arnfjörð Bjarmason, Nov 1, 2021
  61. 06/17 rebase: convert pre-rebase to use hook.hÆvar Arnfjörð Bjarmason, Nov 1, 2021
  62. 10/17 hooks: convert worktree 'post-checkout' hook to hook libraryÆvar Arnfjörð Bjarmason, Nov 1, 2021
  63. 08/17 merge: convert post-merge to use hook.hÆvar Arnfjörð Bjarmason, Nov 1, 2021
  64. 14/17 commit: convert {pre-commit,prepare-commit-msg} hook to hook.hÆvar Arnfjörð Bjarmason, Nov 1, 2021
  65. 17/17 run-command: remove old run_hook_{le,ve}() hook APIÆvar Arnfjörð Bjarmason, Nov 1, 2021
  66. 13/17 git-p4: use 'git hook' to run hooksÆvar Arnfjörð Bjarmason, Nov 1, 2021
  67. 15/17 read-cache: convert post-index-change to use hook.hÆvar Arnfjörð Bjarmason, Nov 1, 2021
  68. 16/17 receive-pack: convert push-to-checkout hook to hook.hÆvar Arnfjörð Bjarmason, Nov 1, 2021
  69. 12/17 send-email: use 'git hook run' for 'sendemail-validate'Ævar Arnfjörð Bjarmason, Nov 1, 2021
  70. 11/17 git hook run: add an --ignore-missing flagÆvar Arnfjörð Bjarmason, Nov 1, 2021
  71. 00/17 hook.[ch]: new library to run hooks + simple hook conversionÆvar Arnfjörð Bjarmason, Nov 23, 2021
  72. 01/17 hook: add 'run' subcommandÆvar Arnfjörð Bjarmason, Nov 23, 2021
  73. 02/17 hook API: add a run_hooks() wrapperÆvar Arnfjörð Bjarmason, Nov 23, 2021
  74. 03/17 gc: use hook library for pre-auto-gc hookÆvar Arnfjörð Bjarmason, Nov 23, 2021
  75. 06/17 rebase: convert pre-rebase to use hook.hÆvar Arnfjörð Bjarmason, Nov 23, 2021
  76. 04/17 am: convert {pre,post}-applypatch to use hook.hÆvar Arnfjörð Bjarmason, Nov 23, 2021
  77. 05/17 hook API: add a run_hooks_l() wrapperÆvar Arnfjörð Bjarmason, Nov 23, 2021
  78. 08/17 merge: convert post-merge to use hook.hÆvar Arnfjörð Bjarmason, Nov 23, 2021
  79. 07/17 am: convert applypatch-msg to use hook.hÆvar Arnfjörð Bjarmason, Nov 23, 2021
  80. 10/17 hooks: convert worktree 'post-checkout' hook to hook libraryÆvar Arnfjörð Bjarmason, Nov 23, 2021
  81. 14/17 commit: convert {pre-commit,prepare-commit-msg} hook to hook.hÆvar Arnfjörð Bjarmason, Nov 23, 2021
  82. 13/17 git-p4: use 'git hook' to run hooksÆvar Arnfjörð Bjarmason, Nov 23, 2021
  83. 15/17 read-cache: convert post-index-change to use hook.hÆvar Arnfjörð Bjarmason, Nov 23, 2021
  84. 16/17 receive-pack: convert push-to-checkout hook to hook.hÆvar Arnfjörð Bjarmason, Nov 23, 2021
  85. 17/17 run-command: remove old run_hook_{le,ve}() hook APIÆvar Arnfjörð Bjarmason, Nov 23, 2021
  86. 12/17 send-email: use 'git hook run' for 'sendemail-validate'Ævar Arnfjörð Bjarmason, Nov 23, 2021
  87. 11/17 git hook run: add an --ignore-missing flagÆvar Arnfjörð Bjarmason, Nov 23, 2021
  88. 09/17 hooks: convert non-worktree 'post-checkout' hook to hook libraryÆvar Arnfjörð Bjarmason, Nov 23, 2021
  89. 00/17 hook.[ch]: new library to run hooks + simple hook conversionÆvar Arnfjörð Bjarmason, Dec 22, 2021
  90. 01/17 hook: add 'run' subcommandÆvar Arnfjörð Bjarmason, Dec 22, 2021
  91. Emily ShafferJan 7, 2022
  92. Junio C HamanoJan 7, 2022
  93. 03/17 gc: use hook library for pre-auto-gc hookÆvar Arnfjörð Bjarmason, Dec 22, 2021
  94. 04/17 am: convert {pre,post}-applypatch to use hook.hÆvar Arnfjörð Bjarmason, Dec 22, 2021
  95. 06/17 rebase: convert pre-rebase to use hook.hÆvar Arnfjörð Bjarmason, Dec 22, 2021
  96. 05/17 hook API: add a run_hooks_l() wrapperÆvar Arnfjörð Bjarmason, Dec 22, 2021
  97. Glen ChooJan 6, 2022
  98. Emily ShafferJan 7, 2022
  99. 02/17 hook API: add a run_hooks() wrapperÆvar Arnfjörð Bjarmason, Dec 22, 2021
  100. Glen ChooJan 6, 2022
  101. 07/17 am: convert applypatch-msg to use hook.hÆvar Arnfjörð Bjarmason, Dec 22, 2021
  102. 10/17 hooks: convert worktree 'post-checkout' hook to hook libraryÆvar Arnfjörð Bjarmason, Dec 22, 2021
  103. 09/17 hooks: convert non-worktree 'post-checkout' hook to hook libraryÆvar Arnfjörð Bjarmason, Dec 22, 2021
  104. 08/17 merge: convert post-merge to use hook.hÆvar Arnfjörð Bjarmason, Dec 22, 2021
  105. 11/17 git hook run: add an --ignore-missing flagÆvar Arnfjörð Bjarmason, Dec 22, 2021
  106. Glen ChooJan 6, 2022
  107. 12/17 send-email: use 'git hook run' for 'sendemail-validate'Ævar Arnfjörð Bjarmason, Dec 22, 2021
  108. 13/17 git-p4: use 'git hook' to run hooksÆvar Arnfjörð Bjarmason, Dec 22, 2021
  109. 14/17 commit: convert {pre-commit,prepare-commit-msg} hook to hook.hÆvar Arnfjörð Bjarmason, Dec 22, 2021
  110. 15/17 read-cache: convert post-index-change to use hook.hÆvar Arnfjörð Bjarmason, Dec 22, 2021
  111. 16/17 receive-pack: convert push-to-checkout hook to hook.hÆvar Arnfjörð Bjarmason, Dec 22, 2021
  112. 17/17 run-command: remove old run_hook_{le,ve}() hook APIÆvar Arnfjörð Bjarmason, Dec 22, 2021
  113. Glen ChooJan 6, 2022
  114. Emily ShafferJan 7, 2022
  115. Emily ShafferJan 7, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.