Guide · Current manual utility
Manual local hooks
Install, inspect, and explicitly run local scripts; normal Dits operations do not invoke them automatically.
Hooks are not wired into commands
dits commit, checkout, merge, rebase, GC, and other operations do not automatically run these files. Network push is disabled, so a hook named pre-push is only a recognized template name. Run a hook explicitly with dits hooks run.Command surface
dits hooks <ACTION> [HOOK] [--force] [-- <ARGS>...]| Action | Current behavior |
|---|---|
| list | List recognized hook names and whether a file is installed |
| install <HOOK> | Write a sample into .dits/hooks, marking it executable on Unix; --force may overwrite |
| uninstall <HOOK> | Remove the named local hook file |
| show <HOOK> | Print the installed file, or the built-in sample if absent |
| run <HOOK> [-- <ARGS>...] | Execute one installed hook manually and propagate failure |
dits hooks list
dits hooks install pre-commit
dits hooks show pre-commit
# Arguments after -- are passed to the executable
dits hooks run pre-commit -- --check
dits hooks uninstall pre-commitRecognized names
pre-commitprepare-commit-msgcommit-msgpost-commitpre-pushpost-mergepre-checkoutpost-checkoutpre-rebasepost-rebasepre-auto-gcpost-rewrite
Names describe intended events, but they do not imply automatic lifecycle integration or a stable argument/stdin contract. The manual CLI runner does not supply stdin.
Execution boundary
Installed scripts live at .dits/hooks/<name>. Manual run executes the file from the repository root, sets DITS_DIR and DITS_HOOK, captures stdout/stderr, and returns nonzero when the script fails.
Hooks execute arbitrary local code
Inspect every script before installing or running it. Built-in samples are starting points and some invoke Git commands; adapt them to your repository and platform. Dits provides no sandbox, signature verification, server-side hooks, or policy enforcement.