Summary
Summary
prek does not appear to expand the PRE_COMMIT_FROM_REF / PRE_COMMIT_TO_REF placeholders used by the upstream Commitizen commitizen-branch hook.
That hook currently defines:
- id: commitizen-branch
entry: cz check
args: [--rev-range, "$PRE_COMMIT_FROM_REF..$PRE_COMMIT_TO_REF"]
always_run: true
pass_filenames: false
stages: [pre-push]
Under pre-commit, this hook works as intended. Under prek, the placeholders appear to be passed through literally.
Versions
prek 0.4.3
commitizen 4.16.2
- macOS
- Git repo with
pre-push hook installed via prek install
Reproduction
Use this .pre-commit-config.yaml snippet:
default_install_hook_types: [pre-commit, commit-msg, pre-push]
repos:
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.16.2
hooks:
- id: commitizen-branch
stages: [pre-push]
Then run either a real push or:
prek run --hook-stage pre-push commitizen-branch -v
Actual result
commitizen check branch..................................................Failed
- hook id: commitizen-branch
- exit code: 23
fatal: ambiguous argument '$PRE_COMMIT_FROM_REF..$PRE_COMMIT_TO_REF': unknown revision or path not in the working tree.
Expected result
prek should provide compatibility with hooks that rely on the PRE_COMMIT_FROM_REF and PRE_COMMIT_TO_REF values during pre-push, so the hook receives a real revision range instead of the literal placeholder string.
Notes
prek docs mention pre-push environment variables, so this looks like a compatibility gap rather than a Commitizen-specific misconfiguration.
Willing to submit a PR?
Platform
MacOS Darwin 25.5.0 x86_64
Version
prek 0.4.3 (02bb73f 2026-05-27)
.pre-commit-config.yaml
- id: commitizen-branch
entry: cz check
args: [--rev-range, "$PRE_COMMIT_FROM_REF..$PRE_COMMIT_TO_REF"]
always_run: true
pass_filenames: false
stages: [pre-push]
Log file
Summary
Summary
prekdoes not appear to expand thePRE_COMMIT_FROM_REF/PRE_COMMIT_TO_REFplaceholders used by the upstream Commitizencommitizen-branchhook.That hook currently defines:
Under
pre-commit, this hook works as intended. Underprek, the placeholders appear to be passed through literally.Versions
prek 0.4.3commitizen 4.16.2pre-pushhook installed viaprek installReproduction
Use this
.pre-commit-config.yamlsnippet:Then run either a real push or:
Actual result
Expected result
prekshould provide compatibility with hooks that rely on thePRE_COMMIT_FROM_REFandPRE_COMMIT_TO_REFvalues duringpre-push, so the hook receives a real revision range instead of the literal placeholder string.Notes
prekdocs mentionpre-pushenvironment variables, so this looks like a compatibility gap rather than a Commitizen-specific misconfiguration.Willing to submit a PR?
Platform
MacOS Darwin 25.5.0 x86_64
Version
prek 0.4.3 (02bb73f 2026-05-27)
.pre-commit-config.yaml
Log file