Getting started
Requirements
- Python 3.13 or newer on
PATH(the script starts with#!/usr/bin/env python3) - A Git working tree (client-side hooks)
The multiplexer is one file. There is nothing to pip install and no package to import.
Install as a Git hook
Copy src/multiplexer into .git/hooks under the hook name you want:
cp /path/to/git-hooks-multiplexer/src/multiplexer .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
The same file can be copied (or symlinked) as pre-merge-commit,
commit-msg, pre-push, and any other supported hook. The installed name is
the hook type.
cp /path/to/git-hooks-multiplexer/src/multiplexer .git/hooks/pre-merge-commit
cp /path/to/git-hooks-multiplexer/src/multiplexer .git/hooks/commit-msg
chmod +x .git/hooks/pre-merge-commit .git/hooks/commit-msg
A symlink is also fine if you keep a clone of this repo on disk:
Add subhooks
Create executables under hooks/<type>/ at the repository root (not
inside .git/hooks):
Git then runs .git/hooks/pre-commit, which runs those files in alphabetic
order.
First check
If hooks/pre-commit/ is missing or empty, the multiplexer exits 0 and Git
continues.
Developing this repository
The steps below are only for changing the multiplexer itself. The hook is the
single file src/multiplexer.