aboutsummaryrefslogtreecommitdiffstats
path: root/hook.h
diff options
context:
space:
mode:
authorEmily Shaffer <emilyshaffer@google.com>2023-02-08 20:21:13 +0100
committerJunio C Hamano <gitster@pobox.com>2023-02-08 12:50:03 -0800
commit917e0802493a39d77c4bdbdf9aaa5d8d69b7a7b0 (patch)
treecd486d5641f1f5ca2df22e39ee6310dd1570c567 /hook.h
parent540267304d37d6257edb3144e770693071d8fbb7 (diff)
downloadgit-917e0802493a39d77c4bdbdf9aaa5d8d69b7a7b0.tar.gz
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>
Diffstat (limited to 'hook.h')
-rw-r--r--hook.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/hook.h b/hook.h
index 4258b13da0..19ab9a5806 100644
--- a/hook.h
+++ b/hook.h
@@ -30,6 +30,11 @@ struct run_hooks_opt
* was invoked.
*/
int *invoked_hook;
+
+ /**
+ * Path to file which should be piped to stdin for each hook.
+ */
+ const char *path_to_stdin;
};
#define RUN_HOOKS_OPT_INIT { \