fix(pre-commit-hooks): correct rev-range syntax in commitizen-branch #1841
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a regression introduced in #1815 where the
commitizen-branchpre-commit hook was incorrectly checking the entire git history instead of just the new commits on the branch.Related Issue
Fixes #1818
Problem
The previous configuration used space-separated arguments for the revision range:
When passed to
git log, this behavior acts as a union, listing all commits reachable from both references. This causedcz checkto validate historical commits that were outside the scope of the current changes.Why It's Broken
..operator: Git range syntax requires..between refsSolution
Updated the
rev-rangeargument to use the correct Git range syntaxFROM..TO:This ensures that
commitizenonly checks the commits introduced in the current branch (fromFROMup toTO).Checklist
Was generative AI tooling used to co-author this PR?
Generated-by: Gemini 3 Pro
Code Changes
uv run poe alllocally to ensure this change passes linter check and testsExpected Behavior
The
commitizen-branchpre-commit hook should only validate the specific commits being pushed or merged (the range betweenFROM_REFandTO_REF).Steps to Verify This Fix
Quick Setup
Create Test Scenario
Test the Bug vs Fix
Expected Results: