Skip to content

Commit f9bbd0d

Browse files
committed
fix(hooks): check only new commits in pre-push, not all since release
The pre-push hook was checking all commits since the last release tag (v0.1.2), which included 4914 commits. This blocked pushes even when problematic commits were already on remote. Changed existing branch logic from: range="$latest_release..$local_sha" # All commits since v0.1.2 To: range="$remote_sha..$local_sha" # Only new commits being pushed This prevents blocking pushes for old commits that already made it to remote, while still catching new commits with AI attribution.
1 parent 8b6df11 commit f9bbd0d

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

.husky/pre-push

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,8 @@ while read local_ref local_sha remote_ref remote_sha; do
3636
range="$local_sha"
3737
fi
3838
else
39-
# Existing branch - check new commits since remote.
40-
# Limit scope to commits after the latest published release on this branch.
41-
latest_release=$(git tag --list 'v*' --sort=-version:refname --merged "$remote_sha" | head -1)
42-
if [ -n "$latest_release" ]; then
43-
# Only check commits after the latest release that are being pushed.
44-
range="$latest_release..$local_sha"
45-
else
46-
# No release tags found - check new commits only.
47-
range="$remote_sha..$local_sha"
48-
fi
39+
# Existing branch - check only new commits being pushed.
40+
range="$remote_sha..$local_sha"
4941
fi
5042

5143
ERRORS=0

0 commit comments

Comments
 (0)