Skip to content

feat: add pre-push hook commands - #15

Merged
alibro005 merged 2 commits into
mainfrom
feat/add-install-hook
Sep 20, 2026
Merged

alibro005 merged 2 commits into
mainfrom
feat/add-install-hook

Conversation

@alibro005

Copy link
Copy Markdown
Owner

Description

Adds Git pre-push hook support to BeforePush, allowing users to run their branch checks automatically before pushing.

Related Issue

Closes #13

Type of Change

  • Bug fix
  • New feature
  • Tests
  • Documentation
  • Refactoring
  • Other

Changes Made

  • Added install-hook and uninstall-hook commands for managing the Git pre-push hook.
  • Prevented existing user hooks from being overwritten or removed.
  • Made hook installation idempotent and added a marker for BeforePush-managed hooks.
  • Added clear handling for Git repository and hook directory errors.
  • Added tests for installation, uninstallation, existing hooks, idempotency, and exit-status propagation.

Testing

  • uv run pytest -v
  • uv run ruff check .
  • uv run ruff format --check .
  • Tested hook installation and uninstallation manually.
  • Tested behavior outside a Git repository.
  • Tested hook exit-status propagation.

@alibro005
alibro005 force-pushed the feat/add-install-hook branch from d6a3a4d to 605853e Compare September 20, 2026 05:11
@alibro005
alibro005 requested a lite review from Copilot September 20, 2026 11:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@alibro005
alibro005 merged commit 811fc9b into main Sep 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add beforepush install-hook command to install BeforePush as a pre-push Git hook

2 participants