An open API service indexing awesome lists of open source software.

https://github.com/hauleth/git-riff

Super simple git hooks launcher
https://github.com/hauleth/git-riff

git git-hooks hooks

Last synced: 2 months ago
JSON representation

Super simple git hooks launcher

Awesome Lists containing this project

README

          

# Git riff

Super simple [Git hooks][git-hooks] launcher. It doesn't manage hooks basing on
some file, it just launch them. So this is more suitable for managing personal
set of hooks instead of managing hooks on organization level.

## Installation

Fetch [git-riff](git-riff) and run it in your repository with `install` option.
Just like this:

./git-riff install

And it is done. If you have some hooks already then you can skip `git-riff` from
overwriting them by running it like that:

yes n | ./git-riff install

If you want your hooks to be managed by `git-riff` then check out
[Usage](#usage) section.

If you do not give a damn and want to thrash all your existing hooks then this
is for you:

yes | ./git-riff install

## Usage

`git-riff` allows you to group your hooks basing on their functionality like
that:

```
.git/
└── hooks
├── # unimportant stuff
└── hooks.d
├── email
│ └── pre-commit
├── style-check
│ └── pre-commit
├── trailing-whitespaces
│ └── pre-commit
├── unresolved-merge
│ └── pre-commit
└── wip-check
└── pre-push
```

So you create directory named `foo` in `.git/hooks/hooks.d` and there you create
executable files that are exactly the same as any other hooks and when hook is
fired all hooks are traversed and ran.

If you want to share your hooks as part of the project then you can create
directory in your project that will have the same structure as `hooks.d`
mentioned above, ex.:

```
.
└── hooks
└── lint
└── pre-commit
```

And then tell `git-riff` to check this directory via setting local configuration
option:

```
git config --local hooks.path $PWD/hooks
```

## License

See [LICENSE](LICENSE).

[git-hooks]: https://git-scm.com/docs/githooks