-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
Description
Problem
When attempting to push changes that exceed the 600-line PR size limit, the pre-push hook fails with an unclear error message:
error: failed to push some refs to 'github.com:SecPal/api.git'
This generic error doesn't explain why the push failed or what to do about it.
Expected Behavior
The error should clearly indicate the size violation:
❌ Pre-push check failed: PR too large
Your changes contain 644 lines (636 insertions, 8 deletions).
Maximum allowed: 600 lines per PR.
Please split your changes into smaller, focused PRs.
Tip: Use --no-verify to bypass this check if necessary.
Actual Behavior
$ git push origin feat/password-reset-email
remote: Enumerating objects: 31, done.
remote: Counting objects: 100% (31/31), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 25 (delta 13), reused 0 (delta 0), pack-reused 0
error: failed to push some refs to 'github.com:SecPal/api.git'Context
- Script:
scripts/preflight.sh - Triggered by:
.git/hooks/pre-pushhook - Discovery: During PR 📧 Implement Password Reset Email Notification (Production Test Phase 2) #79 (Password Reset Email feature)
- Workaround: Used
git push --no-verifyto bypass hook
Root Cause
The preflight.sh script likely has a generic error handler that doesn't provide specific messages for different failure scenarios (test failures vs size violations vs linting errors).
Acceptance Criteria
-
When PR exceeds 600 lines, error message must:
- State the exact line count (insertions + deletions)
- Show the 600-line limit
- Suggest splitting the PR
- Mention
--no-verifybypass option
-
Error should be distinguishable from other pre-push failures (tests, linting, etc.)
-
Consider color-coding: red for error, yellow for warning, blue for info
Related
- Part of Production Test Phase 2 learnings (docs/PRODUCTION_TEST_PHASE2_EMAIL.md)
- Discovered during PR 📧 Implement Password Reset Email Notification (Production Test Phase 2) #79
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
✅ Done