Hookmaster
Some nice git hooks for your pleasure.
Problem:
- You have a policy where every commit message should mention the jira ticket it applies to. You have them in the branch name, and can't be arsed to type them manually to each commit message. Hookmaster provides you with a nice "default" commit message formatter in prepare-commit-msg hook.
- You want to specify commands to run as different git hooks, in a file you share with your team in git.
Installation
uv tool install hookmaster
Usage
To add 'hookmaster' hooks to all projects under /my/path
hookmaster add /my/path
Now, you get a nice commit message hook that maps branch
/bugfixes/SOMETICKET-123-do-stuff
to
SOMETICKET-123: Do stuff
The hooks themselves relay the call to hookmaster, e.g. prepare-commit-msg hooks created by hookmaster looks like this:
#!/bin/sh
hookmaster prepare-commit-msg "$@"
This delegates the message creation to globally installed hookmaster application. This means fixes to hookmaster benefit all your repositories at once.
githooks.toml
For any other hooks, you can specify them in githooks.toml:
pre-commit = "python tasks.py format"
pre-post = "pytest"
# empty string does nothing in the hook
commit-msg = ""
The format should be obvious. The specified command will always be run in repository root.
The hook created by this will look like:
#!/bin/sh
hookmaster run pre-commit
The command hookmaster run will load the githooks.toml file, find the hook and run it.
You can use command hookmaster run pre-commit to test the hook without actually committing
anything.
Usig githooks.toml is optional, if you just want to get the commit message hook.
To easily initalize your repo with githooks.toml, run hookmaster init. It creates a sample
githooks.toml and initializes the hooks. Edit the githooks.toml file to customize
your hooks.
Metadata
Release files for hookmaster 1.4.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hookmaster-1.4.5.tar.gz | 5.6 kB | Without provenance | Details for hookmaster-1.4.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hookmaster-1.4.5-py3-none-any.whl | Python 3 | none | any | Details for hookmaster-1.4.5-py3-none-any.whl |
Total release size: 11.5 kB
Release files / hookmaster-1.4.5.tar.gz
| Download URL | hookmaster-1.4.5.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca39edf7300a32254643c3e3c3dd74a4b02038f6604d9ceaa6efb054e0bb222d
|
|
BLAKE2b-256 checksum How to use checksums |
d7ae820253c1e8b8e7bb9e60e479b9eb96b92152d21d4f27a3fb5fa68fc7b071
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Release files / hookmaster-1.4.5-py3-none-any.whl
| Download URL | hookmaster-1.4.5-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2c20fd3c8623586f322514aee76da6332471b3a2e8c21dfee123d5d8a759ba61
|
|
BLAKE2b-256 checksum How to use checksums |
2552e2bf67e72edc384c9382aa05dc2eee4eaa740a685addc9e27ea2725fd2a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Security for hookmaster 1.4.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.