<commit_before>git-flow-hooks
==============

Some useful hooks for [git-flow (AVH Edition)][1].

What does it do?
================

- Prevent direct commits to the master branch.
- Prevent merge marker commits.
- Automatically bump versions when starting a release or hotfix. Versions are generated, written to file and committed.
- Automatically specify tag messages.

Usage
=====

Install
-------

Clone this repository somewhere on your disk.

```sh
git clone <EMAIL>:jaspernbrouwer/git-flow-hooks.git
```

Whenever your read `/path/to/git-flow-hooks`, replace it with the actual path to your clone/working copy.

### OS X

OS X doesn't support `sort -V`, which is used to sort git tags by version number, which in turn is needed to correctly bump versions.

On OS X you can install [coreutils][6] (using [MacPorts][7] or [Homebrew][8]), after which `gsort -V` can be used.
If it's located at `/opt/local/bin/gsort` or `/usr/local/bin/gsort` we will pick it up automatically.
Otherwise we fall back to `/usr/bin/sort`.

Optionally you can use the configuration option `VERSION_SORT` to point to a different command.

Activate
--------

Initialize git-flow.

```sh
git flow init
```

It will ask you some questions, the last will be `Hooks and filters directory?`, which you can answer with `/path/to/git-flow-hooks`.

If you've already initialized git-flow, you can still set/change the path manually.

```sh
git config gitflow.path.hooks /path/to/git-flow-hooks
```

Update
------

Simply pull any updates from origin.

```sh
cd /path/to/git-flow-hooks
git pull
```

That's it, all your repositories that have git-flow initialized and use `/path/to/git-flow-hooks` as hooks and filters directory will be up-to-date.

Configuration
-------------
<commit_msg>Add notice about pre-commit hooks to readme<commit_after>git-flow-hooks
==============

Some useful hooks for [git-flow (AVH Edition)][1].

What does it do?
================

- Prevent direct commits to the master branch.
- Prevent merge marker commits.
- Automatically bump versions when starting a release or hotfix. Versions are generated, written to file and committed.
- Automatically specify tag messages.

Usage
=====

Install
-------

Clone this repository somewhere on your disk.

```sh
git clone <EMAIL>:jaspernbrouwer/git-flow-hooks.git
```

Whenever your read `/path/to/git-flow-hooks`, replace it with the actual path to your clone/working copy.

### OS X

OS X doesn't support `sort -V`, which is used to sort git tags by version number, which in turn is needed to correctly bump versions.

On OS X you can install [coreutils][6] (using [MacPorts][7] or [Homebrew][8]), after which `gsort -V` can be used.
If it's located at `/opt/local/bin/gsort` or `/usr/local/bin/gsort` we will pick it up automatically.
Otherwise we fall back to `/usr/bin/sort`.

Optionally you can use the configuration option `VERSION_SORT` to point to a different command.

Activate
--------

Initialize git-flow.

```sh
git flow init
```

It will ask you some questions, the last will be `Hooks and filters directory?`, which you can answer with `/path/to/git-flow-hooks`.

If you've already initialized git-flow, you can still set/change the path manually.

```sh
git config gitflow.path.hooks /path/to/git-flow-hooks
```

Prevention hooks
----------------

The hooks that prevent direct commits to the master branch, and prevent merge marker commits, are `pre-commit` hooks.

These only function if they're located in the `.git/hooks` directory of your working copy.
In other words, after activating like described above, these hoods still won't kick in.

I see 2 options:

1. In stead of activating like described above, remove the `.git/hooks` directory and make it a symbolic link (`ln -s /path/to/git-flow-hooks .git/hooks`).
2. Create a symbolic link to the `pre-commit` file (`ln -s /path/to/git-flow-hooks/pre-commit .git/hooks/pre-commit`).

If you know a better way to use the `pre-commit` hooks, please let me know by opening an issue!

Update
------

Simply pull any updates from origin.

```sh
cd /path/to/git-flow-hooks
git pull
```

That's it, all your repositories that have git-flow initialized and use `/path/to/git-flow-hooks` as hooks and filters directory will be up-to-date.

Configuration
-------------

{'fraction_non_alphanumeric': 0.12736620705772378, 'fraction_numerical': 0.002570694087403599, 'mean_word_length': 3.6471226927252984, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7090385', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1264, 'n_words': 564}