5 ms·
You are correct: git 2.54 supports multiple hooks via a the git repo and global configuration files. Git-multi-hook predates that, but I updated it to use the
by netcoyote 3mo ago
You are correct: git 2.54 supports multiple hooks via a the git repo and global configuration files.
Git-multi-hook predates that, but I updated it to use the new 2.54 config-based format.
The significant advantage of git-multi-hook is that they all run in parallel. I run eight hooks on precommit, so parallelism is a big win.
I will update the README to make note. Thanks!
- keybored 3mo agogit-hook documentation says that hook events can be configured to run in parallel.
- netcoyote 3mo agoHere's what gemini says about running hooks in parallel: > Native Git traditionally executes hooks sequentially. However, you can achieve parallel execution by leveraging dedicated third-party hook managers or using built-in shell background processing .. and that's what git-multi-hook is: a third-party hook manager, that uses shell background processing :)
- realitylabs 3mo agoJust out of curiousity, what are the 8 hooks you run?
- netcoyote 3mo agoThe precommit checks I run are: - end-with-blank-line: normalize file endings - find-do-not-commit: do not commit files that include "DO NOT COMMIT" - lint-code: run `$REPO/scripts/lint` if it exists - lint-nodejs: run `$REPO/{pnpm/yarn/npm}` lint if `package.json` exists - lint-shellcheck: shellcheck all the files that have no extensions or end in `.sh` that have a shell-shebang - lint-swift: run swiftlint - prevent-commit-secrets: run ripsecrets to avoid committing secrets and credentials - validate: run `$REPO/scripts/validate` if it exists By default all of the scripts check the files in the git staging area, but they can also be run standalone to check everything. You can find them here: https://github.com/webcoyote/git-multi-hook https://github.com/webcoyote/git-multi-hook. Glad to take suggestions for more.
- keybored 3mo agoI see how it is.