为git用户自动化任务。
flowtool-githooks的Python项目详细描述
[![pypi python版本](https://img.shields.io/pypi/pyversions/flowtool-githooks.svg)](https://pypi.python.org/pypi/flowtool-githooks) [![pypi最新版本](https://img.shields.io/pypi/v/flowtool-githooks.svg)](https://pypi.python.org/pypi/flowtool-githooks) [![pypi分布格式](https://img.shields.io/pypi/format/flowtool-githooks.svg)](https://pypi.python.org/pypi/flowtool-githooks)
flowtool githooks
一些使用细粒度git钩子的功能。
flowtool githhooks背后的主要概念是 一个钩子脚本包将“运行”一个目录。 将在钩子所在的位置旁边创建目录 .git/hooks并且它的名称是hook plus.d。 例如,预提交钩子的目录是 .git/hooks/pre commit.d在钩子脚本旁边: .git/hooks/pre-commit
flowtool githooks发送运行程序脚本并将一些命令添加到 管理钩子目录的内容。
hooks目录中的脚本,.git/hooks/pre commit.d 和.git/hooks/commit msg.d当前仅在以下情况下执行 是可执行的。这是激活和 通过管理命令停用脚本。
##安装
当前,flowtool githhooks包仅包含runner和 管理层的命令。要获取一些预先配置的钩子,请检查 [flowtool githhooks demo](https://github.com/isnok/py-flowlib/tree/master/hooks-demo)包,以及(对于与python相关的hooks) [flowtool python](https://github.com/isnok/py-flowlib/tree/master/pythonic)。
一旦安装了flowtool githhooks和它的需求, 您可以运行
`shell flowtool githooks-install # install the runner (asks before overwriting anything) `
从git存储库中安装钩子。 安装后,可以通过运行
`shell flowtool githooks-config # interactively configure git hooks (needs other hook-pkgs also) `
您还可以只获取当前repo中githooks的状态:
`shell flowtool githooks-status `
##自定义挂钩脚本
目前,在hook目录中创建符号链接更受支持。 要将任意脚本/可执行文件作为git挂钩引入,请使用以下命令:
`shell $ flowtool githooks-introduce--hook <hook_name> /path/to/file $ flowtool githooks-introduce--help # might be helpful as well `
##更多信息
这个包中还包含一个小型的“发现函数”库。 一些钩子脚本使用它来查找要处理的文件。