• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Autohook/Autohook: A very, very small Git hook manager with focus on automation

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

Autohook/Autohook

开源软件地址:

https://github.com/Autohook/Autohook

开源编程语言:

Shell 100.0%

开源软件介绍:

Autohook

Autohook is a very, very small Git hook manager with focus on automation.

It consists of one script which acts as the entry point for all the hooks, and which runs scripts based on symlinks in appropriate directories.

Example

Let's say you have a script to remove .pyc files that you want to run after every git checkout and before every git commit, and another script that runs your test suite that you want to run before every git commit.

Here's the overview of steps:

  1. Put autohook.sh in hooks/.
  2. Run it with install parameter (e.g., ./autohook.sh install).
  3. Put your scripts in hooks/scripts/.
  4. Make sure said scripts are executable (e.g., chmod +x hooks/scripts/delete-pyc-files, etc.).
  5. Make directories for your hook types (e.g., mkdir -p hooks/post-checkout hooks/pre-commit).
  6. Symlink your scripts to the correct directories, using numbers in symlink names to enforce execution order (e.g., ln -s hooks/scripts/delete-pyc-files.sh hooks/post-checkout/01-delete-pyc-files, etc.).

The result should be a tree that looks something like this:

repo_root/
├── hooks/
│   ├── autohook.sh
│   ├── post-checkout/
│   │   └── 01-delete-pyc-files     # symlink to hooks/scripts/delete-pyc-files.sh
│   ├── pre-commit/
│   │   ├── 01-delete-pyc-files     # symlink to hooks/scripts/delete-pyc-files.sh
│   │   └── 02-run-tests            # symlink to hooks/scripts/run-tests.sh
│   └── scripts/
│       ├── delete-pyc-files.sh
│       └── run-tests.sh
├── other_dirs/
└── other_files

You're done!

Contributing

Contributions of all sorts are welcome, be they bug reports, patches, or even just feedback. Creating a new issue or pull request is probably the best way to get started.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License

This software is licensed under the MIT License. Please see the included LICENSE.txt for details.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
dotfiles/dotfiles.github.com: Your unofficial guide to doing dotfiles on GitHub.发布时间:2022-06-11
下一篇:
mlaky88/verzioniranje: Vaje Git发布时间:2022-06-11
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap