Files
beads/cmd/bd
Steven Syrek a5140075f1 fix(hooks): prevent bd hooks install --chain from destroying user's original hook
When bd init installs hooks with chaining, it renames the user's original
hook to .old and creates a new bd hook that chains to it. If bd doctor
later runs bd hooks install --chain, it would:

1. Not recognize the inline bd hook (from bd init) as a bd hook
2. Rename it to .old, overwriting the user's original hook
3. Install a new shim hook

This fix addresses two root causes:

1. Detection mismatch: areBdShimsInstalled() and getHookVersion() now
   recognize inline bd hooks (which have "# bd (beads)" marker) in
   addition to shim hooks (which have "# bd-shim" marker)

2. No .old protection: bd hooks install --chain now checks if .old
   already exists before renaming, preserving the user's original hook

Fixes #1120

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 08:44:30 +01:00
..
2026-01-13 08:41:25 -06:00
2025-12-24 00:06:41 -08:00
2025-12-24 00:06:41 -08:00
2025-12-24 00:06:41 -08:00
2025-12-24 00:06:41 -08:00
2026-01-14 21:57:28 -08:00
2025-12-24 00:06:41 -08:00
2026-01-13 08:41:25 -06:00