https://github.com/git/git
Revision a204756a45bd357280c156d01858138712493dfa authored by Junio C Hamano on 26 February 2006, 23:16:41 UTC, committed by Junio C Hamano on 26 February 2006, 23:16:41 UTC
These two sample hooks try to detect and use the corresponding
commit hook from the same repository.  However, they forgot to
set up GIT_DIR for their own use, so was not in effect.

Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 6d5129a
Raw File
Tip revision: a204756a45bd357280c156d01858138712493dfa authored by Junio C Hamano on 26 February 2006, 23:16:41 UTC
sample hooks template.
Tip revision: a204756
run-command.h
#ifndef RUN_COMMAND_H
#define RUN_COMMAND_H

#define MAX_RUN_COMMAND_ARGS 256
enum {
	ERR_RUN_COMMAND_FORK = 10000,
	ERR_RUN_COMMAND_EXEC,
	ERR_RUN_COMMAND_WAITPID,
	ERR_RUN_COMMAND_WAITPID_WRONG_PID,
	ERR_RUN_COMMAND_WAITPID_SIGNAL,
	ERR_RUN_COMMAND_WAITPID_NOEXIT,
};

#define RUN_COMMAND_NO_STDIO 1
#define RUN_GIT_CMD	     2	/*If this is to be git sub-command */
int run_command_v_opt(int argc, char **argv, int opt);
int run_command_v(int argc, char **argv);
int run_command(const char *cmd, ...);

#endif
back to top