Skip to content

[git-hooks] Make packaged hooks canonical (#92)#93

Merged
coisa merged 5 commits intomainfrom
codex/92-packaged-grumphp-hooks
Apr 18, 2026
Merged

[git-hooks] Make packaged hooks canonical (#92)#93
coisa merged 5 commits intomainfrom
codex/92-packaged-grumphp-hooks

Conversation

@coisa
Copy link
Copy Markdown
Contributor

@coisa coisa commented Apr 18, 2026

Summary

  • Add packaged pre-commit and commit-msg hook templates under resources/git-hooks.
  • Update post-checkout and post-merge to refresh dependencies when composer.json or composer.lock changes.
  • Export DEVTOOLS_* context variables from post-checkout and post-merge hooks.
  • Simplify GitHooksCommand so it only copies/chmods packaged hooks and no longer runs grumphp git:init.
  • Update tests and docs to remove the --skip-grumphp-init behavior.

Verification

  • rg -n "BASE_DIR|skip-grumphp-init|grumphp git:init|hooks_dir" . --glob '!vendor/**' --glob '!tmp/**'
  • sh -n resources/git-hooks/commit-msg && sh -n resources/git-hooks/pre-commit && sh -n resources/git-hooks/post-checkout && sh -n resources/git-hooks/post-merge
  • git diff --check
  • ./vendor/bin/phpunit --filter GitHooksCommandTest (blocked: env: php: No such file or directory)
  • ./vendor/bin/phpunit --filter 'FilesystemTest::symlinkAndReadlinkWillUseAbsolutePaths' (blocked: env: php: No such file or directory)

Notes

  • I kept this scoped to the git hook source of truth only. No BASE_DIR, hooks_dir, grumphp.yml, .gitattributes, or update-composer-json changes are included.
  • The original stash remains available; I applied it, resolved the relevant hook changes, and left unrelated removed-scope changes out of the PR.

Closes #92

@github-actions github-actions Bot added the enhancement New feature or request label Apr 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 18, 2026

coisa added 3 commits April 18, 2026 17:26
… hook installation commands.

Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
…e ENV variable.

Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
@coisa coisa merged commit 20da5de into main Apr 18, 2026
16 checks passed
@coisa coisa deleted the codex/92-packaged-grumphp-hooks branch April 18, 2026 20:47
github-actions Bot added a commit that referenced this pull request Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Released

Development

Successfully merging this pull request may close these issues.

Make packaged git hooks the source of truth

1 participant