Skip to content

Commit a351826

Browse files
committed
Add reference to repo and update doc link
1 parent ebdacaf commit a351826

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/posts/code/git-hooks.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ authors:
44
date: 2021-12-02
55
title: Hooking up with Git
66
subtitle: Managing git hooks with nix
7-
tags: nix, snippets,
7+
tags: nix, git, code, github
88
description: Git hooks can be useful, tracking and managing them with Nix makes removes the barrier of using them.
99
image: https://images.unsplash.com/photo-1621298516851-047f72b40bd7?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1920
1010
status: published
@@ -18,6 +18,12 @@ Git hooks are very useful in theory e.g. to enforce style guidelines of code bei
1818

1919
The presented approach does not solve the underlying issue of mutability but makes git-hooks more trackable and easily appliable.
2020

21+
:::{.note header="Flake"}
22+
An up-to-date version of the presented approach can be [found on GitHub](https://github.com/ysndr/nix-git-hooks).
23+
24+
Please file issues or PRs if you like the project and want to contribute.
25+
:::
26+
2127
# The big picture
2228

2329
Let me present a full-fledged example first, the functions are individually posted down in the [appendix](#appendix).
@@ -131,7 +137,7 @@ hookInstaller = installGitHooks { pre-commit = [rustFormatHook]; }
131137

132138
This will run all commands under `\${rustFormatHook}/bin/*` for `pre-commit` events.
133139

134-
The event types can be arbitrary but have to comply with [actual git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) to be run.
140+
The event types can be arbitrary but have to comply with [actual git hooks](https://git-scm.com/docs/githooks) to be run.
135141

136142
Finally, add the installer (and optionally the uninstall-command) to your dev shell as input programs. You can choose to automatically run the installer at entrance to the shell as a `shellHook` or manually by the user.
137143

@@ -156,6 +162,7 @@ Nonetheless, this might be of interest for someone and if so thanks for reading.
156162
157163
# Appendix
158164
165+
Copy the respective functions here to include them into your project or checkout the [repository on GitHub](https://github.com/ysndr/nix-git-hooks) avoid copy-pasting and receive upstream bugfixes.
159166
## Installer
160167
161168
```nix

0 commit comments

Comments
 (0)