]> git.ipfire.org Git - thirdparty/git.git/commit
hook API: support passing stdin to hooks, convert am's 'post-rewrite'
authorEmily Shaffer <emilyshaffer@google.com>
Wed, 8 Feb 2023 19:21:13 +0000 (20:21 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 8 Feb 2023 20:50:03 +0000 (12:50 -0800)
commit917e0802493a39d77c4bdbdf9aaa5d8d69b7a7b0
treecd486d5641f1f5ca2df22e39ee6310dd1570c567
parent540267304d37d6257edb3144e770693071d8fbb7
hook API: support passing stdin to hooks, convert am's 'post-rewrite'

Convert the invocation of the 'post-rewrite' hook run by 'git am' to
use the hook.h library. To do this we need to add a "path_to_stdin"
member to "struct run_hooks_opt".

In our API this is supported by asking for a file path, rather
than by reading stdin. Reading directly from stdin would involve caching
the entire stdin (to memory or to disk) once the hook API is made to
support "jobs" larger than 1, along with support for executing N hooks
at a time (i.e. the upcoming config-based hooks).

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c
hook.c
hook.h