Skip to main content

Minimal git hook manager for the command line.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yaghm-0.3.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yaghm-0.3.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file yaghm-0.3.1.tar.gz.

File metadata

  • Download URL: yaghm-0.3.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for yaghm-0.3.1.tar.gz
Algorithm Hash digest
SHA256 504c7b966bcadcbb8eeefeff4bbe9a098593ab1eb02f9c1ba3ebd144bbd0e3d7
MD5 865e326217ce17603b3a85e1fddacbd4
BLAKE2b-256 5d8fb0940a7e0a7653761c8316324b5701420e4cb5065986114a302b96913145

See more details on using hashes here.

File details

Details for the file yaghm-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: yaghm-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for yaghm-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0597d83dfe03712e94a7f3b2d2817ca571105bdf4b7a6d3f69b2d74f403f8200
MD5 80374619ac2ff0c0ca55b99c3314247c
BLAKE2b-256 cd2a6752affc2c1cf082a57a952f37a6a26ae9e68f1e54875566f113e699af96

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page