Skip to main content

Yet Another Git Hook Manager

Yaghm is a minimal git hook manager. You write a simple YAML config file listing the hooks you want. yaghm enable enables them in your repo. yaghm disable disables them.:

  • Yaghm is simple. Hooks are not rocket science. The config is just a list of shell commands. When you enable them, yaghm writes a wrapper script in .git/hooks that calls the commands you gave. If they work in your shell they'll work in the hook.
  • Because it's so simple, the documentation is complete, troubleshooting is easy and writing your own extensions is a breeze.
  • Your workflow, not mine. You can store the config wherever you want. Maybe you version your hooks, maybe you don't, maybe you keep them in a separate repo, or your home dir, or your dotfiles...

Usage

To use yaghm, you create a config that lists your hook commands (see detailed syntax):

pre-commit:
  - ...
  # Assuming you have a program called current_branch_not
  - current_branch_not master 
  - enable: black --check .
    install: pip install black
    update: pip install -U black
  - enable: require_version_bump master setup.py
    update: pip install -U metovhooks

post-commit:
  - ...

You can use yaghm -h to see general help. There are three main subcommands (which also support -h):

  • Enable hooks: yaghm enable
  • List enabled hooks: yaghm list
  • Disable hooks: yaghm disable

When using enable and disable, if you pass --dryrun no files will actually be written.

You can also run custom hook commands (e.g. update) with yaghm update. If any hooks in your config specify the command, it will be executed.

Install

Install with pip install yaghm

Further reading

Release files for yaghm 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yaghm 0.3.1
File Size Uploaded
yaghm-0.3.1.tar.gz 9.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yaghm 0.3.1
File Interpreter ABI Platform
yaghm-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.4 kB

Release files / yaghm-0.3.1.tar.gz

Download URL yaghm-0.3.1.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
504c7b966bcadcbb8eeefeff4bbe9a098593ab1eb02f9c1ba3ebd144bbd0e3d7
BLAKE2b-256 checksum
How to use checksums
5d8fb0940a7e0a7653761c8316324b5701420e4cb5065986114a302b96913145
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / yaghm-0.3.1-py3-none-any.whl

Download URL yaghm-0.3.1-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0597d83dfe03712e94a7f3b2d2817ca571105bdf4b7a6d3f69b2d74f403f8200
BLAKE2b-256 checksum
How to use checksums
cd2a6752affc2c1cf082a57a952f37a6a26ae9e68f1e54875566f113e699af96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page