diff --git a/server/src/agents/pool/worktree_lifecycle.rs b/server/src/agents/pool/worktree_lifecycle.rs index 77749d36..016f784a 100644 --- a/server/src/agents/pool/worktree_lifecycle.rs +++ b/server/src/agents/pool/worktree_lifecycle.rs @@ -130,11 +130,20 @@ pub(crate) async fn on_coding_transition(project_root: &Path, port: u16, story_i info.path.display() ); let hook_path = info.path.clone(); + slog!("[worktree] starting pre-commit hook install for '{story_id}'"); let hook_result = tokio::task::spawn_blocking(move || { crate::worktree::install_pre_commit_hook(&hook_path) }) .await .unwrap_or_else(|e| Err(format!("spawn_blocking panicked: {e}"))); + match &hook_result { + Ok(()) => { + slog!("[worktree] finished pre-commit hook install for '{story_id}' result=ok") + } + Err(e) => slog!( + "[worktree] finished pre-commit hook install for '{story_id}' result=err: {e}" + ), + } if let Err(e) = hook_result { slog_warn!( "[worktree-create-sub] Pre-commit hook install failed for '{story_id}': {e}" diff --git a/server/src/worktree/create.rs b/server/src/worktree/create.rs index a78c4c61..6bf269be 100644 --- a/server/src/worktree/create.rs +++ b/server/src/worktree/create.rs @@ -163,12 +163,21 @@ pub fn install_pre_commit_hook(wt_path: &Path) -> Result<(), String> { // Point git at the per-worktree hooks dir so only this worktree uses // these hooks (not the main repo or other worktrees). + slog!( + "[worktree-hook] starting git config --worktree core.hooksPath for '{}'", + wt_path.display() + ); let output = std::process::Command::new("git") .args(["config", "--worktree", "core.hooksPath", ".git-hooks"]) .current_dir(wt_path) .output() .map_err(|e| format!("git config --worktree core.hooksPath: {e}"))?; + slog!( + "[worktree-hook] finished git config --worktree core.hooksPath for '{}' status={}", + wt_path.display(), + output.status + ); if !output.status.success() { let stderr = String::from_utf8_lossy(&output.stderr); return Err(format!(