Adds comprehensive Git worktree support for beads issue tracking: Core changes: - New internal/git/gitdir.go package for worktree detection - GetGitDir() returns proper .git location (main repo, not worktree) - Updated all hooks to use git.GetGitDir() instead of local helper - BeadsDir() now prioritizes main repository's .beads directory Features: - Hooks auto-install in main repo when run from worktree - Shared .beads directory across all worktrees - Config option no-install-hooks to disable auto-install - New bd worktree subcommand for diagnostics Documentation: - New docs/WORKTREES.md with setup instructions - Updated CHANGELOG.md and AGENT_INSTRUCTIONS.md Testing: - Updated tests to use exported git.GetGitDir() - Added worktree detection tests Co-authored-by: Claude <noreply@anthropic.com> Closes: #478
25 lines
663 B
Bash
Executable File
25 lines
663 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Install bd with full version information (commit and branch)
|
|
#
|
|
# Usage:
|
|
# ./scripts/install.sh # Install to GOPATH/bin
|
|
# ./scripts/install.sh /usr/local/bin # Install to custom location
|
|
|
|
set -e
|
|
|
|
INSTALL_DIR="${1:-$(go env GOPATH)/bin}"
|
|
|
|
# Extract git information
|
|
COMMIT=$(git rev-parse HEAD 2>/dev/null || echo "")
|
|
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "")
|
|
|
|
echo "Installing bd to $INSTALL_DIR..."
|
|
echo " Commit: ${COMMIT:0:12}"
|
|
echo " Branch: $BRANCH"
|
|
|
|
go install -ldflags="-X main.Commit=$COMMIT -X main.Branch=$BRANCH" ./cmd/bd
|
|
|
|
echo "✓ bd installed successfully"
|
|
echo ""
|
|
"$INSTALL_DIR"/bd version
|