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

[PATCH v5 0/8] propose config-based hooks (part I)

From
Emily Shaffer <emilyshaffer@google.com>
Date
Oct 14, 2020, 23:24 UTC
Message-ID
<20201014232447.3050579-1-emilyshaffer@google.com>
In-Reply-To
<20200909004939.1942347-1-emilyshaffer@google.com>
Since v4:
- Reordered the commits. Hookdir support is added sooner and conversion
  of existing hooks is moved to another branch (part II) for hopefully
  more granular reviewing. If folks hate this, let me know and I'll
  reintegrate the two topics.
- Removed the --porcelain option on 'git hook list'. General consensus
  is that this should use a format string instead, and I didn't want to
  write that new feature while I had been promising v5 "any day now".
- Added functionality for 'skip' to remove hooks from the execution
  list.
- General nits from folks.
Coming soon:
- 'git hook list --format'
- More conversions (in the other topic)
- As required by new conversions, stdin support for hooks
Coming much later:
- 'git hook add'/'git hook edit'. The config isn't too ugly to manually
  edit, for now, so I'd like to get the hooks themselves all figured out
  before adding these convenience tools. I do still think they're a good
  idea, as they'll increase the discoverability of the feature for new
  users.

More detailed notes in each commit. Thanks all for your patience and reviews.

 - Emily
Emily Shaffer (8):
  doc: propose hooks managed by the config
  hook: scaffolding for git-hook subcommand
  hook: add list command
  hook: include hookdir hook in list
  hook: implement hookcmd.<name>.skip
  parse-options: parse into strvec
  hook: add 'run' subcommand
  hook: replace find_hook() with hook_exists()
 .gitignore                                    |   1 +
 Documentation/Makefile                        |   1 +
 Documentation/config/hook.txt                 |  14 +
 Documentation/git-hook.txt                    |  81 ++++
 Documentation/technical/api-parse-options.txt |   5 +
 .../technical/config-based-hooks.txt          | 367 ++++++++++++++++++
 Makefile                                      |   2 +
 builtin.h                                     |   1 +
 builtin/hook.c                                | 163 ++++++++
 git.c                                         |   1 +
 hook.c                                        | 282 ++++++++++++++
 hook.h                                        |  58 +++
 parse-options-cb.c                            |  16 +
 parse-options.h                               |   4 +
 t/t1360-config-based-hooks.sh                 | 232 +++++++++++
 15 files changed, 1228 insertions(+)
 create mode 100644 Documentation/config/hook.txt
 create mode 100644 Documentation/git-hook.txt
 create mode 100644 Documentation/technical/config-based-hooks.txt
 create mode 100644 builtin/hook.c
 create mode 100644 hook.c
 create mode 100644 hook.h
 create mode 100755 t/t1360-config-based-hooks.sh
-- 
2.28.0.rc0.142.g3c755180ce-goog
Next: Emily Shaffer
Message 1 of 12 in “propose config-based hooks (part I)”
  1. 0/8 propose config-based hooks (part I)Emily Shaffer, Oct 14, 2020
  2. 3/8 hook: add list commandEmily Shaffer, Oct 14, 2020
  3. 6/8 parse-options: parse into strvecEmily Shaffer, Oct 14, 2020
  4. 8/8 hook: replace find_hook() with hook_exists()Emily Shaffer, Oct 14, 2020
  5. 1/8 doc: propose hooks managed by the configEmily Shaffer, Oct 14, 2020
  6. Ævar Arnfjörð BjarmasonOct 15, 2020
  7. Junio C HamanoOct 16, 2020
  8. Emily ShafferOct 21, 2020
  9. 5/8 hook: implement hookcmd.<name>.skipEmily Shaffer, Oct 14, 2020
  10. 4/8 hook: include hookdir hook in listEmily Shaffer, Oct 14, 2020
  11. 2/8 hook: scaffolding for git-hook subcommandEmily Shaffer, Oct 14, 2020
  12. 7/8 hook: add 'run' subcommandEmily Shaffer, Oct 14, 2020

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.