Simple hook management for Git
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Library
bin
spec
.gitignore
.gitmodules
.travis.yml
.yardopts
CHANGELOG.md
Gemfile
LICENSE
README.md
Thorfile

README.md

Mestral

Build Status Coverage Status Code Climate Dependency Status

A hook manager for Git

About

Mestral allows to easily manage your Git hooks. Combine so called hooklets to form the hooks fitting your needs.

Installation

Mestral can be installed via a simple installation script:

$ ruby -e "$(curl -fLsS https://raw.github.com/mestral/mestral/install/install.rb)"

On Unix-like system, this will install Mestral into /usr/local/mestral. On Windows, this will install Mestral into %ALLUSERSPROFILE%/Mestral. An executable called git-hooks will be put into place, so you can run Mestral using $ git hooks.

You can also clone the Git repository and symlink the executable into your $PATH. For example:

$ git clone http://github.com/mestral/mestral.git
$ ln -s mestral/bin/mestral /usr/local/bin/mestral

Additionally, you might want to add it as a command to Git, for example:

$ ln -s mestral/bin/mestral /usr/local/bin/git-hooks

Getting started

Initially, you should add a hook repository, also known as a tape.

$ mestral add-tape https://github.com/mestral/tape

After that, list the available hooklets

$ mestral list

… and enable those you like for the current Git repository:

$ mestral enable pre-commit check-whitespace

Additionally, you can execute a Git hook manually:

$ mestral execute pre-commit

License

This code is free software; you can redistribute it and/or modify it under the terms of the new BSD License. A copy of this license can be found in the LICENSE file.

Credits

  • Sebastian Staudt – koraktor(at)gmail.com