feat(polecat): add repo path to worktrees for LLM ergonomics (GH#283)
Changes polecat worktree structure from: polecats/<name>/ to: polecats/<name>/<rigname>/ This gives Claude Code agents a recognizable directory name (e.g., tidepool/) in their cwd instead of just the polecat name, preventing confusion about which repo they are working in. Key changes: - Add clonePath() method to manager.go and session_manager.go for the actual git worktree path, keeping polecatDir() for existence checks - Update Add(), RepairWorktree(), Remove() to use new structure - Update daemon lifecycle and restart code for new paths - Update witness handlers to detect both structures - Update doctor checks (rig_check, branch_check, config_check, claude_settings_check) for backward compatibility - All code includes fallback to old structure for existing polecats Fixes #283 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
c8c97fdf64
commit
9b2f4a7652
@@ -579,7 +579,7 @@ func runPolecatSync(cmd *cobra.Command, args []string) error {
|
||||
polecatName = ""
|
||||
}
|
||||
|
||||
mgr, r, err := getPolecatManager(rigName)
|
||||
mgr, _, err := getPolecatManager(rigName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -606,10 +606,15 @@ func runPolecatSync(cmd *cobra.Command, args []string) error {
|
||||
// Sync each polecat
|
||||
var syncErrors []string
|
||||
for _, name := range polecatsToSync {
|
||||
polecatDir := filepath.Join(r.Path, "polecats", name)
|
||||
// Get polecat to get correct clone path (handles old vs new structure)
|
||||
p, err := mgr.Get(name)
|
||||
if err != nil {
|
||||
syncErrors = append(syncErrors, fmt.Sprintf("%s: %v", name, err))
|
||||
continue
|
||||
}
|
||||
|
||||
// Check directory exists
|
||||
if _, err := os.Stat(polecatDir); os.IsNotExist(err) {
|
||||
if _, err := os.Stat(p.ClonePath); os.IsNotExist(err) {
|
||||
syncErrors = append(syncErrors, fmt.Sprintf("%s: directory not found", name))
|
||||
continue
|
||||
}
|
||||
@@ -623,7 +628,7 @@ func runPolecatSync(cmd *cobra.Command, args []string) error {
|
||||
fmt.Printf("Syncing %s/%s...\n", rigName, name)
|
||||
|
||||
syncCmd := exec.Command("bd", syncArgs...)
|
||||
syncCmd.Dir = polecatDir
|
||||
syncCmd.Dir = p.ClonePath
|
||||
output, err := syncCmd.CombinedOutput()
|
||||
if err != nil {
|
||||
syncErrors = append(syncErrors, fmt.Sprintf("%s: %v", name, err))
|
||||
|
||||
Reference in New Issue
Block a user