standard-githooks
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.
Main entry points
parse— parse hook file content into a list of commandsmatches_any— check if staged files match a glob patterndefault_mode— get the default execution mode for a hooksubstitute_msg— replace{msg}tokens in commandsgenerate_shim— generate a shim script for a hook
Hook file format
Each .githooks/<hook>.hooks file contains one command per
line with an optional prefix and trailing glob:
# Comment
[prefix]command [arguments] [glob]
Prefixes: (none) = hook default, ! = fail fast,
? = advisory.
Part of git-std
This crate is one of four libraries powering git-std, a single binary for conventional commits, versioning, changelog, and git hooks.
License
MIT