From eb63a803563d55e7f821eb8415230b7db781f5ae Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Mon, 9 Mar 2026 12:31:35 -0400 Subject: [PATCH] Add base commit and branch to `arc run` initial output Shows "Base: main (260a391e5b4c)" after the Worktree line in the run header, helping users identify the starting point. Uses worktree base SHA when available, falls back to remote base SHA for remote-only runs. Co-Authored-By: Claude Opus 4.6 --- crates/arc-workflows/src/cli/progress.rs | 18 ++++++++++++++++++ crates/arc-workflows/src/cli/run.rs | 19 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/crates/arc-workflows/src/cli/progress.rs b/crates/arc-workflows/src/cli/progress.rs index 4501023a8..5af9c3e17 100644 --- a/crates/arc-workflows/src/cli/progress.rs +++ b/crates/arc-workflows/src/cli/progress.rs @@ -695,6 +695,24 @@ impl ProgressUI { } } + pub fn show_base_info(&mut self, branch: Option<&str>, sha: &str) { + let short_sha = &sha[..sha.len().min(12)]; + let text = match branch { + Some(b) => format!("Base: {b} ({short_sha})"), + None => format!("Base: {short_sha}"), + }; + match &self.renderer { + ProgressRenderer::Tty(tty) => { + let bar = tty.multi.add(ProgressBar::new_spinner()); + bar.set_style(style_static_dim()); + bar.finish_with_message(text); + } + ProgressRenderer::Plain => { + eprintln!(" {text}"); + } + } + } + // ── Stages ────────────────────────────────────────────────────────── fn on_stage_started(&mut self, node_id: &str, name: &str, script: Option<&str>) { diff --git a/crates/arc-workflows/src/cli/run.rs b/crates/arc-workflows/src/cli/run.rs index ef1727cdd..3bf2fcb72 100644 --- a/crates/arc-workflows/src/cli/run.rs +++ b/crates/arc-workflows/src/cli/run.rs @@ -550,6 +550,13 @@ pub async fn run_command( .show_worktree(wt); } + if let Some(ref sha) = worktree_base_sha { + progress_ui + .lock() + .expect("progress lock poisoned") + .show_base_info(detected_base_branch.as_deref(), sha); + } + let cwd = std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")); let daytona_config = resolve_daytona_config(run_cfg.as_ref(), &run_defaults); let exe_config = resolve_exe_config(run_cfg.as_ref(), &run_defaults); @@ -715,6 +722,18 @@ pub async fn run_command( (None, None, None) }; + if worktree_base_sha.is_none() { + if let Some(ref sha) = remote_base_sha { + let branch = detected_base_branch + .as_deref() + .or(remote_base_branch.as_deref()); + progress_ui + .lock() + .expect("progress lock poisoned") + .show_base_info(branch, sha); + } + } + // Create SSH access if requested if args.ssh { match sandbox.ssh_access_command().await {