Skip to content

Externalize git hook logic into a dedicated git-hooks package #336

@coisa

Description

@coisa

Context

Issue #296 was merged as an intermediate fix while the broader git-hooks extraction work is still pending.

resources/git-hooks still contains the hook runtime logic, and the GrumPHP binary fallbacks were fixed directly in this repository in a temporary way.

Problem

We need a dedicated package boundary for Git hooks instead of keeping lifecycle scripts inside dev-tools, so this repository can depend on the extracted hook package and avoid duplicated or environment-specific logic.

Scope

  • Create and publish a dedicated fast-forward/git-hooks package/repository (or integrate the final target package that already exists) to host the managed Git hook scripts.
  • Migrate existing hook scripts from resources/git-hooks/* while preserving behavior for:
    • commit-msg
    • post-checkout
    • post-merge
    • pre-commit
  • Update dev-tools synchronization and installation flow to consume the externalized package instead of embedding the full hook logic.
  • Keep local and global execution compatibility, including GrumPHP resolution order and project-local overrides.
  • Keep documentation and generated output in sync with the new source-of-truth for hooks.

Acceptance Criteria

  • Hook execution logic is implemented in the dedicated git-hooks package and no longer maintained only inside resources/git-hooks.
  • dev-tools git-hooks installs and updates the expected hooks in consumer repositories.
  • GrumPHP invocation order remains unchanged in behavior for managed workflows:
    1. vendor/bin/grumphp
    2. vendor/bin/grumphp.phar
    3. grumphp in PATH
  • Existing and regression tests for GitHooksCommand and self-update/global path checks remain green.
  • README/usage and command help that mention Git hook installation reflect the new package flow.
  • Any required changelog note is added for user-facing or release-process behavior changes.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions