Automating tasks for git users.
Project description
[![PyPI Python Versions](https://img.shields.io/pypi/pyversions/flowtool-githooks.svg)](https://pypi.python.org/pypi/flowtool-githooks) [![PyPI Latest Version](https://img.shields.io/pypi/v/flowtool-githooks.svg)](https://pypi.python.org/pypi/flowtool-githooks) [![PyPI Distribution Format](https://img.shields.io/pypi/format/flowtool-githooks.svg)](https://pypi.python.org/pypi/flowtool-githooks)
flowtool-githooks
Some functionality to use granular git hooks.
The main concept behind flowtool-githooks is, that instead of running one single hook script the package will ‘run’ a directory instead. The directory will be created right next to where the hook is in .git/hooks and it has the name of the hook plus .d. So for example the directory for the pre-commit hook is .git/hooks/pre-commit.d right next to the hook script: .git/hooks/pre-commit
flowtool-githooks ships the runner script and adds some commands to manage the content of the hook directories.
Scripts inside the hooks directory, .git/hooks/pre-commit.d and .git/hooks/commit-msg.d currently, are only executed, if the are executable. This is an old way of activating and deactivating the scripts by the management command.
## Installation
Currently the flowtool-githooks package contains only the runner and the management commands. To get some pre configured hooks check the [flowtool-githooks-demo](https://github.com/isnok/py-flowlib/tree/master/hooks-demo) package, and (for python-related hooks) [flowtool-python](https://github.com/isnok/py-flowlib/tree/master/pythonic).
Once you have flowtool-githooks and it’s requirements installed, you can run
`shell flowtool githooks-install # install the runner (asks before overwriting anything) `
from inside a git repository to install the hooks. When they are installed, they can be configred interactively by running
`shell flowtool githooks-config # interactively configure git hooks (needs other hook-pkgs also) `
And you can also just get the status of githooks in the current repo:
`shell flowtool githooks-status `
## Custom hook scripts
Currently it is better supported to create symlinks in the hook directory. To introduce arbitrary scripts/executables as git hooks use the command:
`shell $ flowtool githooks-introduce --hook <hook_name> /path/to/file $ flowtool githooks-introduce --help # might be helpful as well `
## More to come
There is also a small library of “discovery functions” contained in this package. It is used by some hook scripts to find files to take care of.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for flowtool_githooks-0.7.37-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61d40e29ccf81d1ec57226ad927142310de6ce2de8f4c52c8c46eabf2052ed32 |
|
MD5 | e70e383296f86301d84a8320461bbfc9 |
|
BLAKE2b-256 | f5f72f4f981f43471cc31bfd6d54f8b28fd5d638687bcdcbff10ab73856e32c6 |