Skip to content

Commit a12f914

Browse files
authored
Merge pull request #473 from pre-commit/2_21_0
add documentation for 2.11.0
2 parents 032ec6c + 193880f commit a12f914

File tree

4 files changed

+30
-12
lines changed

4 files changed

+30
-12
lines changed

sections/advanced.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ manually edited during conflict resolution. This also includes files which
6464
were automatically merged by git. Git isn't perfect and this can often catch
6565
implicit conflicts (such as with removed python imports).
6666

67+
_new in 2.11.0_ pre-commit can be used to manage [post-merge] hooks.
68+
69+
To use `post-merge` hooks with pre-commit, run:
70+
71+
```console
72+
$ pre-commit install --hook-type post-merge
73+
pre-commit installed at .git/hooks/post-merge
74+
```
75+
76+
The hook fires after a successful `git merge`.
77+
78+
[post-merge]: https://git-scm.com/docs/githooks#_post_merge
79+
6780
## pre-commit during clean merges
6881

6982
_new in 1.21.0_ pre-commit can be used to manage [pre-merge-commit] hooks.
@@ -187,7 +200,7 @@ to run at the `push` stage.
187200
Hooks can however be confined to a stage by setting the [`stages`](#config-stages)
188201
property in your `.pre-commit-config.yaml`. The [`stages`](#config-stages) property
189202
is an array and can contain any of `commit`, `merge-commit`, `push`, `prepare-commit-msg`,
190-
`commit-msg` and `manual`.
203+
`commit-msg`, `post-checkout`, `post-commit`, `post-merge`, and `manual`.
191204

192205
If you do not want to have hooks installed by default on the stage passed
193206
during a `pre-commit install --hook-type ...`, please set the [`default_stages`](#top_level-default_stages)

sections/cli.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ Install hook script in a directory intended for use with
9595

9696
Options:
9797

98-
- `-t {pre-commit,pre-merge-commit,pre-push,prepare-commit-msg,commit-msg,post-checkout,post-commit}`,
99-
`--hook-type {pre-commit,pre-merge-commit,pre-push,prepare-commit-msg,commit-msg,post-checkout,post-commit}`:
98+
- `-t {pre-commit,pre-merge-commit,pre-push,prepare-commit-msg,commit-msg,post-checkout,post-commit,post-merge}`,
99+
`--hook-type {pre-commit,pre-merge-commit,pre-push,prepare-commit-msg,commit-msg,post-checkout,post-commit,post-merge}`:
100100
which hook type to install.
101101

102102
Some example useful invocations:
@@ -132,8 +132,8 @@ Options:
132132
- `--install-hooks`: Also install environments for all available hooks now
133133
(rather than when they are first executed). See [`pre-commit
134134
install-hooks`](#pre-commit-install-hooks).
135-
- `-t {pre-commit,pre-merge-commit,pre-push,prepare-commit-msg,commit-msg,post-checkout,post-commit}`,
136-
`--hook-type {pre-commit,pre-merge-commit,pre-push,prepare-commit-msg,commit-msg,post-checkout,post-commit}`:
135+
- `-t {pre-commit,pre-merge-commit,pre-push,prepare-commit-msg,commit-msg,post-checkout,post-commit,post-merge}`,
136+
`--hook-type {pre-commit,pre-merge-commit,pre-push,prepare-commit-msg,commit-msg,post-checkout,post-commit,post-merge}`:
137137
Specify which hook type to install.
138138
- `--allow-missing-config`: Hook scripts will permit a missing configuration
139139
file.
@@ -238,6 +238,6 @@ Uninstall the pre-commit script.
238238

239239
Options:
240240

241-
- `-t {pre-commit,pre-merge-commit,pre-push,prepare-commit-msg,commit-msg}`,
242-
`--hook-type {pre-commit,pre-merge-commit,pre-push,prepare-commit-msg,commit-msg}`: which hook
243-
type to uninstall.
241+
- `-t {pre-commit,pre-merge-commit,pre-push,prepare-commit-msg,commit-msg,post-checkout,post-commit,post-merge}`,
242+
`--hook-type {pre-commit,pre-merge-commit,pre-push,prepare-commit-msg,commit-msg,post-checkout,post-commit,post-merge}`:
243+
which hook type to uninstall.

sections/new-hooks.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ file that tells pre-commit:
7575
=r=
7676
=c= [`stages`](_#hooks-stages)
7777
=c= (optional: default (all stages)) confines the hook to the `commit`, `merge-commit`,
78-
`push`, `prepare-commit-msg`, `commit-msg`, `post-checkout`, `post-commit`, or
79-
`manual` stage. See
78+
`push`, `prepare-commit-msg`, `commit-msg`, `post-checkout`, `post-commit`,
79+
`post-merge`, or `manual` stage. See
8080
[Confining hooks to run at certain stages](#confining-hooks-to-run-at-certain-stages).
8181
8282
```
@@ -149,6 +149,7 @@ Hello from foo hook!
149149
- [perl](#perl)
150150
- [python](#python)
151151
- [python_venv](#python_venv)
152+
- [r](#r)
152153
- [ruby](#ruby)
153154
- [rust](#rust)
154155
- [swift](#swift)
@@ -346,6 +347,10 @@ instead.
346347
__Support:__ python hooks work without any system-level dependencies. It
347348
has been tested on linux, macOS, windows, and cygwin.
348349
350+
### r
351+
352+
_new in 2.11.0_
353+
349354
### ruby
350355
351356
The hook repository must have a `*.gemspec`. It will be installed via

sections/plugins.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ repository's configuration.
142142
=r=
143143
=c= [`stages`](_#config-stages)
144144
=c= (optional) confines the hook to the `commit`, `merge-commit`, `push`,
145-
`prepare-commit-msg`, `commit-msg`, `post-checkout`, `post-commit`, or
146-
`manual` stage. See
145+
`prepare-commit-msg`, `commit-msg`, `post-checkout`, `post-commit`,
146+
`post-merge`, or `manual` stage. See
147147
[Confining hooks to run at certain stages](#confining-hooks-to-run-at-certain-stages).
148148
=r=
149149
=c= [`additional_dependencies`](_#config-additional_dependencies)

0 commit comments

Comments
 (0)