Liking cljdoc? Tell your friends :D

Git Hook

You can use git hooks to have Git invoke custom scripts for specific Git events.

Some folks add a commit-msg hook to have Git automatically run the poly check command to validate their workspace on git commit. If the poly check fails, the git commit is aborted.

From your workspace root directory, you’d add an executable ./git/hooks/commit-msg script, something like the following would work on macOS or Linux:

./git/hooks/commit-msg
#!/usr/bin/env bash

set -eou pipefail

clojure -M:poly check color-mode:none
Don’t forget to chmod +x ./get/hooks/commit-msg.
Client-side git hooks are developer-specific and not tracked by git.
Failing hooks can be mysterious when committing from an IDE. If the commit hook fails, the commit will fail, but you might not get a meaningful message as to why.
The example git hook script above invokes poly via the :poly alias. For better performance, you might explore having your git hook script invoke poly as a stand-alone AOT-compiled jar.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close