Skip to main content

Crate standard_githooks

Crate standard_githooks 

Source
Expand description

Git hooks file format parsing, shim generation, and execution model.

Owns the .githooks/<hook>.hooks file format. Can read/write hook files and generate shim scripts. Does not execute commands, run git operations, or produce terminal output.

Structs§

HookCommand
A single command parsed from a .githooks/<hook>.hooks file.

Enums§

HookMode
The execution mode for a hook.
Prefix
The execution mode for a hook command.

Constants§

KNOWN_HOOKS
All git hook types managed by git-std, in recommended install order.

Functions§

default_mode
Return the default execution mode for a given hook name.
generate_hooks_template
Generate the .hooks template file content for a given hook name.
generate_shim
Generate the shim script content for a given hook name.
matches_any
Returns true if at least one path in files matches the given glob pattern.
parse
Parse the text content of a .githooks/<hook>.hooks file.
substitute_msg
Replace {msg} tokens in a command string with the given file path.