Skip to content

Commit a7e1203

Browse files
steveyeggeclaude
andcommitted
fix(hooks): use bd hooks run instead of nonexistent bd hook in shim templates
The post-checkout, post-merge, and pre-commit shim templates called bd hook <name> which does not exist as a CLI command. The correct command is bd hooks run <name> (matching prepare-commit-msg and pre-push which were already correct). This caused git worktree creation to fail, blocking gt sling to the beads rig. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 362608a commit a7e1203

3 files changed

Lines changed: 8 additions & 25 deletions

File tree

cmd/bd/templates/hooks/post-checkout

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,14 @@
44
#
55
# bd (beads) post-checkout hook - thin shim
66
#
7-
# This shim delegates to 'bd hook post-checkout' which contains
7+
# This shim delegates to 'bd hooks run post-checkout' which contains
88
# the actual hook logic. This pattern ensures hook behavior is always
99
# in sync with the installed bd version - no manual updates needed.
10-
#
11-
# The 'bd hook' command (singular) supports:
12-
# - Guard against frequent firing
13-
# - Per-worktree state tracking
14-
# - Dolt branch-then-merge pattern
15-
# - Hook chaining configuration
1610

1711
# Check if bd is available
1812
if ! command -v bd >/dev/null 2>&1; then
1913
# Silently skip - post-checkout is called frequently
2014
exit 0
2115
fi
2216

23-
exec bd hook post-checkout "$@"
17+
exec bd hooks run post-checkout "$@"

cmd/bd/templates/hooks/post-merge

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@
44
#
55
# bd (beads) post-merge hook - thin shim
66
#
7-
# This shim delegates to 'bd hook post-merge' which contains
7+
# This shim delegates to 'bd hooks run post-merge' which contains
88
# the actual hook logic. This pattern ensures hook behavior is always
99
# in sync with the installed bd version - no manual updates needed.
10-
#
11-
# The 'bd hook' command (singular) supports:
12-
# - Dolt push/pull sync
13-
# - Per-worktree state tracking
14-
# - Hook chaining configuration
1510

1611
# Check if bd is available
1712
if ! command -v bd >/dev/null 2>&1; then
@@ -21,4 +16,4 @@ if ! command -v bd >/dev/null 2>&1; then
2116
exit 0
2217
fi
2318

24-
exec bd hook post-merge "$@"
19+
exec bd hooks run post-merge "$@"

cmd/bd/templates/hooks/pre-commit

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,9 @@
44
#
55
# bd (beads) pre-commit hook — thin shim
66
#
7-
# Delegates to 'bd hook pre-commit' which contains the actual hook logic.
8-
# This pattern ensures hook behavior is always in sync with the installed
9-
# bd version — no manual updates needed.
10-
#
11-
# The 'bd hook' command supports:
12-
# - Per-worktree export state tracking
13-
# - Dolt in-process export (no lock deadlocks)
14-
# - Sync-branch routing
15-
# - Hook chaining configuration
7+
# Delegates to 'bd hooks run pre-commit' which contains the actual hook
8+
# logic. This pattern ensures hook behavior is always in sync with the
9+
# installed bd version — no manual updates needed.
1610

1711
# Check if bd is available
1812
if ! command -v bd >/dev/null 2>&1; then
@@ -22,4 +16,4 @@ if ! command -v bd >/dev/null 2>&1; then
2216
exit 0
2317
fi
2418

25-
exec bd hook pre-commit "$@"
19+
exec bd hooks run pre-commit "$@"

0 commit comments

Comments
 (0)