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

Re: [PATCH v2 0/8] Makefile: generate a hook-list.h, prep for config-based-hooks

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Sep 27, 2021, 09:30 UTC
Message-ID
<8d2ccf02-09ad-3876-9c9f-2dd79f9221bc@gmail.com>
In-Reply-To
<cover-v2-0.8-00000000000-20210926T185800Z-avarab@gmail.com>
On 26/09/2021 20:03, Ævar Arnfjörð Bjarmason wrote:
Show 23 quoted lines
> This series is an incremental restart of the now-ejected
> es/config-based-hooks and ab/config-based-hooks-base topics. See [1]
> for a summary of the plan and progression.
> 
> In v2 the "sed" invocation that generates the new hook-list.h has been
> changed to be portable under POSIX. See the thread starting at
> https://lore.kernel.org/git/92471ff9-7573-c3e4-e9fd-63a5cbf5738f@gmail.com/;
> 
> The portability issue is AFAICT theoretical in that any "sed" command
> I've tried accepts the old version (I tried the large list of OS's
> listed in [2]), but better safe than sorry.
> 
> Other changes:
> 
>   * I noticed that the run-command.h inclusion in transport.c become
>     redundant, I removed that and validated the other ones that have
>     the new hook.h, they all still need run-command.h.
> 
>   * A whitespace change in v1 in a change to the Makefile makes the
>     diff for 8/8 easier to read.
> 
> 1. http://lore.kernel.org/git/cover-0.8-00000000000-20210923T095326Z-avarab@gmail.com
> 2. https://lore.kernel.org/git/87fstt3gzd.fsf@evledraar.gmail.com/
 > [...]
Show 14 quoted lines
> 8:  80aae4d5c13 ! 8:  7420267ce09 hook-list.h: add a generated list of hooks, like config-list.h
>      @@ Makefile: XDIFF_LIB = xdiff/lib.a
>        generated-hdrs: $(GENERATED_H)
>        
>       @@ Makefile: git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)
>      + 		$(filter %.o,$^) $(LIBS)
>        
>        help.sp help.s help.o: command-list.h
>      ++hook.sp hook.s hook.o: hook-list.h
>        
>       -builtin/help.sp builtin/help.s builtin/help.o: config-list.h GIT-PREFIX
>      -+hook.sp hook.s hook.o: hook-list.h
>      -+
>       +builtin/help.sp builtin/help.s builtin/help.o: config-list.h hook-list.h GIT-PREFIX

This is billed as a whitespace change above but this line has actually changed since the last version - was that intentional?

Show 13 quoted lines
>        builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
>        	'-DGIT_HTML_PATH="$(htmldir_relative_SQ)"' \
>      @@ generate-hooklist.sh (new)
>       +static const char *hook_name_list[] = {
>       +EOF
>       +
>      -+sed -n -e '/^~~~~*$/ {x; s/^.*$/	"&",/; p;}; x' \
>      ++sed -n \
>      ++	-e '/^~~~~*$/ {x; s/^.*$/	"&",/; p;}' \
>      ++	-e 'x' \
>       +	<Documentation/githooks.txt |
>       +	LC_ALL=C sort
>       +
The sed change looks good
Thanks
Phillip
Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 37 of 39 in “Makefile: generate a hook-list.h, prep for config-based-hooks”
  1. 0/8 Makefile: generate a hook-list.h, prep for config-based-hooksÆvar Arnfjörð Bjarmason, Sep 23, 2021
  2. 1/8 Makefile: mark "check" target as .PHONYÆvar Arnfjörð Bjarmason, Sep 23, 2021
  3. 2/8 Makefile: stop hardcoding {command,config}-list.hÆvar Arnfjörð Bjarmason, Sep 23, 2021
  4. 3/8 Makefile: don't perform "mv $@+ $@" dance for $(GENERATED_H)Ævar Arnfjörð Bjarmason, Sep 23, 2021
  5. 4/8 Makefile: remove an out-of-date commentÆvar Arnfjörð Bjarmason, Sep 23, 2021
  6. 5/8 hook.[ch]: move find_hook() from run-command.c to hook.cÆvar Arnfjörð Bjarmason, Sep 23, 2021
  7. 6/8 hook.c: add a hook_exists() wrapper and use it in bugreport.cÆvar Arnfjörð Bjarmason, Sep 23, 2021
  8. 7/8 hook.c users: use "hook_exists()" instead of "find_hook()"Ævar Arnfjörð Bjarmason, Sep 23, 2021
  9. 8/8 hook-list.h: add a generated list of hooks, like config-list.hÆvar Arnfjörð Bjarmason, Sep 23, 2021
  10. Phillip WoodSep 24, 2021
  11. Junio C HamanoSep 24, 2021
  12. René ScharfeSep 24, 2021
  13. Ævar Arnfjörð BjarmasonSep 24, 2021
  14. René ScharfeSep 24, 2021
  15. Ævar Arnfjörð BjarmasonSep 24, 2021
  16. Phillip WoodSep 27, 2021
  17. Ævar Arnfjörð BjarmasonSep 27, 2021
  18. Mike HommeyNov 15, 2021
  19. Ævar Arnfjörð BjarmasonNov 15, 2021
  20. Mike HommeyNov 15, 2021
  21. Ævar Arnfjörð BjarmasonNov 15, 2021
  22. Mike HommeyNov 15, 2021
  23. Ævar Arnfjörð BjarmasonNov 16, 2021
  24. Junio C HamanoNov 17, 2021
  25. 0/8 Makefile: generate a hook-list.h, prep for config-based-hooksÆvar Arnfjörð Bjarmason, Sep 26, 2021
  26. 1/8 Makefile: mark "check" target as .PHONYÆvar Arnfjörð Bjarmason, Sep 26, 2021
  27. 2/8 Makefile: stop hardcoding {command,config}-list.hÆvar Arnfjörð Bjarmason, Sep 26, 2021
  28. 3/8 Makefile: don't perform "mv $@+ $@" dance for $(GENERATED_H)Ævar Arnfjörð Bjarmason, Sep 26, 2021
  29. 4/8 Makefile: remove an out-of-date commentÆvar Arnfjörð Bjarmason, Sep 26, 2021
  30. 5/8 hook.[ch]: move find_hook() from run-command.c to hook.cÆvar Arnfjörð Bjarmason, Sep 26, 2021
  31. 6/8 hook.c: add a hook_exists() wrapper and use it in bugreport.cÆvar Arnfjörð Bjarmason, Sep 26, 2021
  32. 7/8 hook.c users: use "hook_exists()" instead of "find_hook()"Ævar Arnfjörð Bjarmason, Sep 26, 2021
  33. 8/8 hook-list.h: add a generated list of hooks, like config-list.hÆvar Arnfjörð Bjarmason, Sep 26, 2021
  34. Junio C HamanoSep 27, 2021
  35. René ScharfeSep 27, 2021
  36. Junio C HamanoSep 27, 2021
  37. Phillip WoodSep 27, 2021
  38. Ævar Arnfjörð BjarmasonSep 27, 2021
  39. Phillip WoodSep 27, 2021

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.