| command | pre-merge-commit |
|---|---|
| summary | Install / manage a pre-merge-commit hook that runs `mdsmith fix` after a merge. |
Manage a Git pre-merge-commit hook that runs
mdsmith fix . after Git resolves every per-file merge
(and the merge driver regenerates
<?catalog?>/<?include?> blocks) but before the merge
commit is created. Modified .md / .markdown files are
re-staged automatically.
A concurrent git process can briefly hold
.git/index.lock. When git add fails for that reason,
the hook retries with a bounded backoff. A transient
lock no longer aborts the merge. The hook never deletes
a lock it did not create. If the lock outlasts the
retries, the hook prints index locked and exits
non-zero, so the merge stops instead of committing a
partially staged tree.
mdsmith pre-merge-commit <subcommand> [args]
Install the hook at .git/hooks/pre-merge-commit, or at
the path configured by core.hooksPath. The hook walks
the worktree using .mdsmith.yml ignore:.
The hook's scope is a superset of the merge driver's:
.gitattributes generation skips ignore: entries that
can't be represented (! negation patterns, patterns
with whitespace), so the hook may run mdsmith fix on
files the merge driver wasn't
registered for.
Explicit file lists are not accepted. Scope the hook by
editing .mdsmith.yml ignore: instead.
Remove the hook if it was installed by mdsmith. Refuses to remove user-authored hooks.
Show whether the hook is installed and whether the installed script matches the canonical glob-based template.
mdsmith pre-merge-commit install
mdsmith pre-merge-commit status
mdsmith pre-merge-commit uninstallmdsmith merge-driver— runs first, per-file, before this hook