Skip to content

v2.66.2 - audit works in pre-commit hooks

Choose a tag to compare

@BartWaardenburg BartWaardenburg released this 07 May 06:34
· 3966 commits to main since this release
v2.66.2
4e148af

Bug fixes

  • fallow audit now works inside pre-commit and pre-push hooks. When git runs hooks, it exports ambient repository-state environment variables into the hook subprocess: GIT_INDEX_FILE=.git/index (a relative path), plus GIT_PREFIX and friends. Audit's git worktree add was inheriting those, and the relative GIT_INDEX_FILE failed to resolve from the temporary worktree directory, so worktree creation aborted with could not create a temporary worktree for base ref 'main'. The published workaround was env -u GIT_INDEX_FILE fallow audit; that's no longer necessary.

    Every production git invocation in fallow now strips the documented set of ambient repo-state variables (GIT_DIR, GIT_WORK_TREE, GIT_INDEX_FILE, GIT_OBJECT_DIRECTORY, GIT_COMMON_DIR, GIT_PREFIX) via a shared helper. lint-staged, husky, lefthook, and the pre-commit framework all work transparently. The same robustness applies to churn / hotspot analysis, regression baselines, coverage uploads, init's branch detection, and vital signs. The worktree-creation error also surfaces a hint when an ambient repo-state variable is detected, so users on older fallow versions can self-rescue.

    Thanks @videvian for the report. (Closes #301)

Full Changelog: v2.66.1...v2.66.2