unstale

npm / pre-commit

pre-commit

What changed in pre-commit 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-27.

3 breaking2 security4 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.8 on npm

pre-commit 29 changes

Breaking changes 3

  • The generated wrapper is now a small bash script that execs the package's hook file via an absolute path; scripts parsing the wrapper must adjust.

    2.0.0release notes

  • Node.js 16.13 or newer is now required.

    2.0.0release notes

  • Signal-terminated scripts are no longer treated as successful.

    2.0.0release notes

Security 2

  • Hook file mode is tightened from 0777 to 0755.

    2.0.0release notes

  • Gitdir parsing is hardened against missing matches and bad input, and gitdir paths are resolved relative to the directory containing the .git file.

    2.0.0release notes

Fixes and other changes 4

  • The hook unsets this environment variable so commits triggered from emacs/magit behave like command-line commits.

    2.0.0release notes

  • The hook changes to the git root before resolving pre-commit, helping Yarn Plug'n'Play and GUI git clients with an unexpected working directory.

    2.0.0release notes

  • If the package is missing, the hook warns and exits 0 instead of throwing a module-not-found stack trace, so commits are not blocked.

    2.0.0release notes

  • Submodule installs now write the pre-commit hook under the submodule's git modules directory; linked worktrees are handled correctly too.

    2.0.0release notes