class documentation
class ShellHook(Hook):
Known subclasses: dulwich.hooks.CommitMsgShellHook, dulwich.hooks.PostCommitShellHook, dulwich.hooks.PostReceiveShellHook, dulwich.hooks.PreCommitShellHook, dulwich.hooks.PreReceiveShellHook, dulwich.hooks.UpdateShellHook
Constructor: ShellHook(name, path, numparam, pre_exec_callback, ...)
Hook by executable file.
Implements standard githooks(5) [0]:
[0] http://www.kernel.org/pub/software/scm/git/docs/githooks.html
| Method | __init__ |
Setup shell hook definition. |
| Method | execute |
Execute the hook with given args. |
| Instance Variable | cwd |
Undocumented |
| Instance Variable | filepath |
Undocumented |
| Instance Variable | name |
Undocumented |
| Instance Variable | numparam |
Undocumented |
| Instance Variable | post |
Undocumented |
| Instance Variable | pre |
Undocumented |
def __init__(self, name:
str, path: str, numparam: int, pre_exec_callback: Callable[ ..., Any] | None = None, post_exec_callback: Callable[ ..., Any] | None = None, cwd: str | None = None):
¶
overridden in
dulwich.hooks.CommitMsgShellHook, dulwich.hooks.PostCommitShellHook, dulwich.hooks.PostReceiveShellHook, dulwich.hooks.PreCommitShellHook, dulwich.hooks.PreReceiveShellHook, dulwich.hooks.UpdateShellHookSetup shell hook definition.
| Parameters | |
name:str | name of hook for error messages |
path:str | absolute path to executable file |
numparam:int | number of requirements parameters |
preCallable[ | closure for setup before execution Defaults to None. Takes in the variable argument list from the execute functions and returns a modified argument list for the shell hook. |
postCallable[ | closure for cleanup after execution Defaults to None. Takes in a boolean for hook success and the modified argument list and returns the final hook return value if applicable |
cwd:str | None | working directory to switch to when executing the hook |
overrides
dulwich.hooks.Hook.executeoverridden in
dulwich.hooks.PostReceiveShellHook, dulwich.hooks.PreReceiveShellHook, dulwich.hooks.UpdateShellHookExecute the hook with given args.