- Breaking: requires Node.js 16.13 or newer.
engines.nodeis now declared as">=16.13.0"to match the minimum required bywhich@4. - Breaking:
cross-spawnupgraded^5→^7.0.5, fixing the ReDoS vulnerability (GHSA-3xgq-45jj-v275).cross-spawn'sspawnSyncnow returnsstatus/signal/errorinstead ofcode;index.jswas updated to match. - Breaking:
whichupgraded1.2.x→^4. Thespawn-syncruntime dependency is dropped in favor ofcross-spawn's built-inspawnSync. - Breaking: the generated
.git/hooks/pre-commitwrapper is rewritten. It is now a small bash script thatexecs the package'shookfile via an absolute path (single-line invocation instead of multi-line inline bash). Anyone parsing the wrapper file will need to adjust. - Breaking: hook file mode tightened from
0777to0755(CIS 6.1.10). - Breaking: submodule installs now write to
<super>/.git/modules/<sub>/hooks/pre-commit. The previous behavior silently walked up to the super-project's.gitdirectory and installed there because the gitdir-parsing branch was unreachable. Linked worktrees (whose.gitis also a file) are handled correctly too. - The hook now
unsetsGIT_LITERAL_PATHSPECS, so commits triggered from emacs/magit behave the same as on the command line (magit FAQ). - The hook now
cds to the git root before resolvingpre-commitviarequire.resolve, so Yarn Plug'n'Play and GUI git clients that invoke hooks with an unexpected cwd resolve dependencies correctly. - The hook is resilient to a missing
pre-commitpackage: switching to a branch withoutnode_modules(or removing the package) no longer blocks commits — it exits0with a warning instead of throwing a Node module-not-found stack trace. - Fixed handling of
nullclose codes and signal-terminated scripts; the hook no longer treats a signal kill as success. - Hardened
install.jsgitdir parsing against missing matches and bad input;gitdir:paths are resolved relative to the directory containing the.gitfile (was incorrectly resolved against the package root). install.js: typo fix ("backuped"→"backed up").- Dev tooling refresh:
mocha3 → 10,assume1 → 2, droppedistanbulfornyc.
- Check
/usr/local/bin/nodeif we cannot find the binaries in the PATH.
- Corrected the
hookfile so it doesn't attempt to run your index.js but ours instead.
- Create symlinks instead of a copying the hook file so we can depend on modules.
- More readable output messages.
- Lookup git and npm using
which. - Allow nodejs, node and iojs to call the the hook.
- Refactored the way options can be passed in to pre-commit, we're now allowing objects.
- The refactor made it possible to test most of the internals so we now have 90%+ coverage.
- And the list goes on.
- Added missing uninstall hook to remove and restore old scripts.
- Added support for installing custom commit templates using
pre-commit.commit-template
- Fixes regression introduced in 0.0.6
- Also silence
npmoutput when the silent flag has been given.
- Allow silencing of the pre-commit output by setting a
precommit.silent: truein yourpackage.json
- Added a better error message when you fucked up your
package.json. - Only run tests if there are changes.
- Improved output formatting.
- Added compatibility for Node.js 0.6 by falling back to path.existsSync.
- Fixed a typo in the output, see #1.
- Use
spawninstead ofexecand give custom file descriptors. This way we can output color and have more control over the process.
- Initial release.