Repository navigation
Closed
Description
Goal
Refactor the pre-push hook to align its operator experience with the new pre-commit behavior:
concise output by default, verbose streaming on demand, and structured JSON output for automation.
Background
Issue #1769 introduced a stronger CLI and reporting contract for pre-commit, including:
--format=<text|json>--verbosity=<concise|verbose>and--verbosealias- concise per-step summaries with log-path and failure tail
- optional workspace-local log directory via environment variable
contrib/dev-tools/git/hooks/pre-push.sh still uses legacy output behavior. This creates an
inconsistent local workflow and weaker automation ergonomics in the heavier validation gate.
Because pre-push includes nightly checks and E2E, this refactor should keep the check set intact
while improving clarity, observability, and parity with pre-commit.
Scope
In Scope
- Add
--format=<text|json>to pre-push withtextas default. - Add
--verbosity=<concise|verbose>withconciseas default. - Keep
--verboseas alias for--verbosity=verbose. - Add concise failure summaries (step, status, elapsed, log path, failure tail).
- Add JSON output mode with one structured payload to stdout.
- Add configurable per-step log directory env var (follow pre-commit contract).
- Preserve existing pre-push validation steps, including E2E.
- Update docs/skills so pre-commit and pre-push behavior is consistent.
Out of Scope
- Changing which checks run in pre-push.
- Moving E2E out of pre-push.
- CI workflow redesign.
- Broader hook framework rewrite into Rust CLI (future option only).
Implementation Plan
Status values: TODO, IN_PROGRESS, BLOCKED, DONE.
| ID | Status | Task | Notes / Expected Output |
|---|---|---|---|
| T1 | TODO | Define pre-push CLI/output contract | Final behavior matrix and error handling documented |
| T2 | TODO | Implement hook refactor | pre-push.sh supports format/verbosity/log-dir parity |
| T3 | TODO | Validate behavior in pass and fail paths | Text concise/verbose + JSON tested with exit-code verification |
| T4 | TODO | Update docs and skills | Workflow docs aligned with pre-push capabilities |
| T5 | TODO | Run quality checks and finalize evidence | linter all and targeted checks pass |
Acceptance Criteria
- AC1:
pre-push.shsupports--format=<text|json>and--verbosity=<concise|verbose>with--verbosealias. - AC2:
--format=text --verbosity=conciseprints high-signal per-step summary; failures include log path and short tail. - AC3:
--format=jsonemits one valid JSON document to stdout with step-level status and timing. - AC4: Invalid/unknown flags fail with exit code
2, usage hint, and stderr diagnostics. - AC5: Existing pre-push check ownership is preserved (including E2E in pre-push).
- AC6: Log-directory override env var is supported and documented (parity with pre-commit behavior).
-
linter allexits with code0 - Relevant tests pass
- Documentation is updated when behavior/workflow changes
References
- Related issues: Refactor pre-commit checks for lower verbosity and faster feedback #1769
- Hook scripts:
contrib/dev-tools/git/hooks/pre-commit.sh,contrib/dev-tools/git/hooks/pre-push.sh - Full spec:
docs/issues/open/1780-refactor-pre-push-checks-performance-and-verbosity.md
Metadata
Metadata
Assignees
Labels
No labels
Activity
chore(issues): archive closed specs #669, #1771, #1778 and fix pre-pu…
Merge #1781: chore(issues): archive closed specs #669, #1771, #1778 a…
docs(issues): record design decisions and refine plan for #1780
chore(git-hooks): add pre-push dispatcher to .githooks
chore(git-hooks): make output mode explicit in .githooks dispatchers
chore(git-hooks): use JSON as default output format in .githooks disp…
docs(issues): move closed issue specs #1778 and #1780 to closed/
Merge #1788: docs(issues): add specs for #1786 and #1787, move closed…
Merge torrust#1783: feat(pre-push): add format/verbosity/log-dir pari…