Commit b4cbcbf
feat(git-hooks): Add signature for smart hook redeployment
Add signature comment to git hook and update deployment logic to:
- Detect if existing pre-commit hook is php-qa-ci managed (via signature)
- If managed: overwrite with updated version (automatic updates)
- If custom: skip deployment (preserve user customizations)
SIGNATURE FORMAT:
# PHP-QA-CI-HOOK-SIGNATURE: pre-commit-check-vendor-uncommitted
# DO NOT EDIT: This hook is managed by php-qa-ci
DEPLOYMENT LOGIC:
1. Check if .git/hooks/pre-commit exists
2. If exists, grep for signature
3. If signature found → overwrite (it's our hook, update it)
4. If signature not found → skip (it's custom, preserve it)
5. If doesn't exist → install fresh
This allows automatic hook updates via composer update while respecting
custom user hooks.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 486a29f commit b4cbcbf
2 files changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
286 | | - | |
287 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
288 | 296 | | |
289 | 297 | | |
290 | 298 | | |
| |||
0 commit comments