Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

perf(alias): parallelize prewarm git/config/user-config reads (#2573)

Maximilian Roos5f56d2aecd89
diff --git a/src/commands/alias.rs b/src/commands/alias.rs
index b5a78773c..f759a697e 100644
--- a/src/commands/alias.rs
+++ b/src/commands/alias.rs
@@ -43,8 +43,8 @@ use std::collections::{BTreeMap, BTreeSet};
use anyhow::{Context, bail};
use color_print::cformat;
use worktrunk::config::{
- ALIAS_ARGS_KEY, CommandConfig, HookStep, LoadedConfigs, ProjectConfig, UserConfig,
- alias_context_filter, format_alias_variables, referenced_vars_for_config,
+ ALIAS_ARGS_KEY, CommandConfig, HookStep, ProjectConfig, UserConfig, alias_context_filter,
+ format_alias_variables, referenced_vars_for_config,
};
use worktrunk::git::Repository;
use worktrunk::styling::{
@@ -435,10 +435,8 @@ pub fn try_alias(name: String, rest: Vec<String>, global_yes: bool) -> anyhow::R
let Ok(repo) = Repository::current() else {
return Ok(None);
};
- let LoadedConfigs {
- user: user_config,
- project: project_config,
- } = LoadedConfigs::load(&repo)?;
+ let user_config = repo.user_config();
+ let project_config = repo.project_config()?;
let aliases = {
let _span = Span::new("load_aliases");
load_aliases(Some(&repo), user_config, project_config)
@@ -492,10 +490,8 @@ pub fn try_alias(name: String, rest: Vec<String>, global_yes: bool) -> anyhow::R
/// be handled with a dedicated error hint.
pub fn step_alias(args: Vec<String>, global_yes: bool) -> anyhow::Result<()> {
let repo = Repository::current()?;
- let LoadedConfigs {
- user: user_config,
- project: project_config,
- } = LoadedConfigs::load(&repo)?;
+ let user_config = repo.user_config();
+ let project_config = repo.project_config()?;
let aliases = load_aliases(Some(&repo), user_config, project_config);
let Some(name) = args.first().cloned() else {
bail!("Missing alias name");
diff --git a/src/commands/config/alias.rs b/src/commands/config/alias.rs
index 892c686cf..190a91d70 100644
--- a/src/commands/config/alias.rs
+++ b/src/commands/config/alias.rs
@@ -23,8 +23,8 @@ use std::io::Write;
use anyhow::Context;
use color_print::cformat;
use worktrunk::config::{
- ALIAS_ARGS_KEY, CommandConfig, LoadedConfigs, ProjectConfig, UserConfig,
- referenced_vars_for_config, template_references_var, validate_template_syntax,
+ ALIAS_ARGS_KEY, CommandConfig, ProjectConfig, UserConfig, referenced_vars_for_config,
+ template_references_var, validate_template_syntax,
};
use worktrunk::git::{Repository, WorktrunkError};
use worktrunk::styling::{format_bash_with_gutter, info_message, println};
@@ -43,10 +43,8 @@ use crate::commands::hooks::HookSource;
/// entries are printed (user first, matching runtime execution order).
pub fn handle_alias_show(name: String) -> anyhow::Result<()> {
let repo = Repository::current()?;
- let LoadedConfigs {
- user: user_config,
- project: project_config,
- } = LoadedConfigs::load(&repo)?;
+ let user_config = repo.user_config();
+ let project_config = repo.project_config()?;
let entries = entries_for_name(&repo, user_config, project_config, &name);
if entries.is_empty() {
@@ -96,10 +94,8 @@ fn warn_if_shadowed(name: &str) {
/// Other templates expand against the current context.
pub fn handle_alias_dry_run(name: String, args: Vec<String>) -> anyhow::Result<()> {
let repo = Repository::current()?;
- let LoadedConfigs {
- user: user_config,
- project: project_config,
- } = LoadedConfigs::load(&repo)?;
+ let user_config = repo.user_config();
+ let project_config = repo.project_config()?;
let entries = entries_for_name(&repo, user_config, project_config, &name);
if entries.is_empty() {
diff --git a/src/commands/config/update.rs b/src/commands/config/update.rs
index 2fb644517..4ba521998 100644
--- a/src/commands/config/update.rs
+++ b/src/commands/config/update.rs
@@ -10,7 +10,7 @@ use std::path::PathBuf;
use anyhow::Context;
use worktrunk::config::{
DeprecationInfo, compute_migrated_content, config_path,
- copy_approved_commands_to_approvals_file, format_deprecation_warnings, format_migration_diff,
+ copy_approved_commands_to_approvals_file, format_migration_diff,
};
use worktrunk::git::Repository;
use worktrunk::styling::{
@@ -54,11 +54,11 @@ pub fn handle_config_update(yes: bool, print: bool) -> anyhow::Result<()> {
if print {
// Emit migrated content to stdout. Multiple configs → separate with a
- // labeled header so the output is still parseable. Warnings still go
- // to stderr so stdout stays clean for piping.
+ // labeled header so the output is still parseable. Deprecation
+ // warnings already went to stderr from `Repository::prewarm`'s
+ // user-config preload, so we don't re-emit them here.
let multi = candidates.len() > 1;
for (idx, candidate) in candidates.iter().enumerate() {
- eprint!("{}", format_deprecation_warnings(&candidate.info));
if multi {
if idx > 0 {
println!();
@@ -118,10 +118,11 @@ pub fn handle_config_update(yes: bool, print: bool) -> anyhow::Result<()> {
/// Format update preview for display.
///
-/// Shows deprecation warnings and diff, but omits the "To apply" hint
-/// since `config update` will apply automatically.
+/// Shows the diff. Deprecation warnings already went to stderr from
+/// `Repository::prewarm`'s user-config preload, so we don't re-emit them
+/// here.
fn format_update_preview(candidate: &UpdateCandidate) -> String {
- let mut out = format_deprecation_warnings(&candidate.info);
+ let mut out = String::new();
let label = candidate
.config_path
diff --git a/src/commands/context.rs b/src/commands/context.rs
index 93177d2d0..2f065f56e 100644
--- a/src/commands/context.rs
+++ b/src/commands/context.rs
@@ -1,6 +1,6 @@
use anyhow::Context;
use std::path::PathBuf;
-use worktrunk::config::{LoadedConfigs, UserConfig};
+use worktrunk::config::UserConfig;
use worktrunk::git::Repository;
use super::command_executor::CommandContext;
@@ -76,12 +76,11 @@ impl CommandEnv {
let branch = current_wt
.branch()
.context("Failed to determine current branch")?;
- // Warm both configs in parallel; downstream hook code reads project
- // from the cache. Clone user out — `CommandEnv` owns its config.
- let config = LoadedConfigs::load(&repo)
- .context("Failed to load config")?
- .user
- .clone();
+ // Warm the project config so downstream hook code reads it from the
+ // cache and any deprecation warnings surface here, before hook output.
+ // Clone user out — `CommandEnv` owns its config.
+ repo.project_config().context("Failed to load config")?;
+ let config = repo.user_config().clone();
Ok(Self {
repo,
diff --git a/src/commands/hook_commands.rs b/src/commands/hook_commands.rs
index 8e9133573..9bbb66271 100644
--- a/src/commands/hook_commands.rs
+++ b/src/commands/hook_commands.rs
@@ -12,8 +12,7 @@ use color_print::cformat;
use strum::IntoEnumIterator;
use worktrunk::HookType;
use worktrunk::config::{
- ALIAS_ARGS_KEY, Approvals, CommandConfig, LoadedConfigs, ProjectConfig, UserConfig,
- referenced_vars_for_config,
+ ALIAS_ARGS_KEY, Approvals, CommandConfig, ProjectConfig, UserConfig, referenced_vars_for_config,
};
use worktrunk::git::Repository;
use worktrunk::path::format_path_for_display;
@@ -375,9 +374,10 @@ pub fn handle_hook_show(
use crate::help_pager::show_help_in_pager;
let repo = Repository::current().context("Failed to show hooks")?;
- let configs = LoadedConfigs::load(&repo).context("Failed to load configs")?;
- let config: &UserConfig = configs.user;
- let project_config: Option<&ProjectConfig> = configs.project;
+ let config: &UserConfig = repo.user_config();
+ let project_config: Option<&ProjectConfig> = repo
+ .project_config()
+ .context("Failed to load project config")?;
let approvals = Approvals::load().context("Failed to load approvals")?;
let project_id = repo.project_identifier().ok();
diff --git a/src/commands/picker/mod.rs b/src/commands/picker/mod.rs
index 0faa3ba24..d67edfbae 100644
--- a/src/commands/picker/mod.rs
+++ b/src/commands/picker/mod.rs
@@ -727,13 +727,12 @@ pub fn handle_picker(
} else {
Repository::current().context("Failed to switch worktree")?
};
- // Warm both configs in parallel; project sits in the cache for
- // downstream `run_pre_switch_hooks` / `plan_switch`. Clone user out
- // so `offer_bare_repo_worktree_path_fix` can mutate locally.
- let mut config = worktrunk::config::LoadedConfigs::load(&repo)
- .context("Failed to load config")?
- .user
- .clone();
+ // Warm the project config so it sits in the cache for downstream
+ // `run_pre_switch_hooks` / `plan_switch` and any deprecation warnings
+ // surface before hook output. Clone user out so
+ // `offer_bare_repo_worktree_path_fix` can mutate locally.
+ repo.project_config().context("Failed to load config")?;
+ let mut config = repo.user_config().clone();
offer_bare_repo_worktree_path_fix(&repo, &mut config)?;
// Run pre-switch hooks before branch resolution or worktree creation.
diff --git a/src/commands/step_commands.rs b/src/commands/step_commands.rs
index 27dfc8f1c..1135240f2 100644
--- a/src/commands/step_commands.rs
+++ b/src/commands/step_commands.rs
@@ -24,7 +24,7 @@ use ignore::gitignore::GitignoreBuilder;
use path_slash::PathExt as _;
use rayon::prelude::*;
use worktrunk::HookType;
-use worktrunk::config::{CopyIgnoredConfig, LoadedConfigs, UserConfig};
+use worktrunk::config::{CopyIgnoredConfig, UserConfig};
use worktrunk::copy::{copy_dir_recursive, copy_leaf};
use worktrunk::git::{Repository, WorktreeInfo};
use worktrunk::path::format_path_for_display;
@@ -721,11 +721,11 @@ fn resolve_copy_ignored_config(repo: &Repository) -> anyhow::Result<CopyIgnoredC
let mut config = CopyIgnoredConfig {
exclude: default_copy_ignored_excludes(),
};
- let LoadedConfigs {
- user: user_config,
- project: project_config,
- } = LoadedConfigs::load(repo).context("Failed to load configs")?;
- if let Some(project_config) = project_config.as_ref()
+ let user_config = repo.user_config();
+ let project_config = repo
+ .project_config()
+ .context("Failed to load project config")?;
+ if let Some(project_config) = project_config
&& let Some(project_copy_ignored) = project_config.copy_ignored()
{
config = config.merged_with(project_copy_ignored);
diff --git a/src/config/loaded.rs b/src/config/loaded.rs
deleted file mode 100644
index 831dce972..000000000
--- a/src/config/loaded.rs
+++ /dev/null
@@ -1,86 +0,0 @@
-//! Bundle type for loading user and project config together.
-//!
-//! [`LoadedConfigs::load`] warms the user-config and project-config caches in
-//! parallel on scoped threads, then returns borrows into the per-`Repository`
-//! cache. Both fields go through the same caching path, so subsequent
-//! `Repository::user_config` / `Repository::project_config` calls are pure
-//! cache hits — no second disk read, no asymmetry.
-//!
-//! ## When to use
-//!
-//! Call [`LoadedConfigs::load`] from command handlers that consume both
-//! configs — alias dispatch, `wt config alias show`/`dry-run`,
-//! `wt hook show`, hook execution, picker post-switch. Sites that only
-//! consume `UserConfig` (e.g. `wt step eval`, `for-each`, `prune`,
-//! `relocate`) call [`UserConfig::load`] directly so they don't trigger
-//! `.config/wt.toml` reads or project-config deprecation warnings.
-//!
-//! ## Why not return a merged config?
-//!
-//! User and project configs serve different roles — user config is trusted,
-//! project config requires command approval. Downstream merges
-//! (`load_aliases`, hook resolution) keep the source distinction so
-//! per-source policy can be applied. A flattened merged struct would erase
-//! that. Methods that walk both sources with the right precedence belong on
-//! `LoadedConfigs` itself as the bundle grows.
-//!
-//! ## Warning ordering
-//!
-//! Both loads emit deprecation/unknown-field warnings to stderr inline.
-//! Running them on sibling threads makes warning order nondeterministic
-//! when both files have warnings. No existing test fixture exercises both
-//! at once. Acceptable trade-off for the parallel savings; revisit with
-//! a buffer-and-replay design if the ordering becomes a problem.
-
-use anyhow::Result;
-
-use crate::git::Repository;
-use crate::trace::Span;
-
-use super::{ProjectConfig, UserConfig};
-
-/// User and project configs borrowed together from `repo`'s cache.
-///
-/// `project` is `None` when the repo has no `.config/wt.toml`. Lifetime
-/// `'r` is tied to the `Repository` whose cache the references point into.
-pub struct LoadedConfigs<'r> {
- pub user: &'r UserConfig,
- pub project: Option<&'r ProjectConfig>,
-}
-
-impl<'r> LoadedConfigs<'r> {
- /// Warm the user- and project-config caches in parallel; warm
- /// `project_identifier` alongside the project load.
- ///
- /// On a cold cache the wall-clock cost is the longest pole rather than
- /// the sum (~6ms vs ~13ms sequential on a typical project). On a warm
- /// cache both threads are no-ops.
- ///
- /// `project_identifier` shares its thread with the project-config load
- /// because both touch the same `Repository` and have no warning
- /// interleave concern; combining them saves a spawn/join for the same
- /// wall pole (the identifier's `git config --list -z` dominates either
- /// way).
- pub fn load(repo: &'r Repository) -> Result<Self> {
- std::thread::scope(|s| {
- s.spawn(|| {
- let _span = Span::new("user_config_load");
- let _ = repo.user_config();
- });
- s.spawn(|| {
- {
- let _span = Span::new("project_config_load");
- let _ = repo.project_config();
- }
- {
- let _span = Span::new("project_identifier_warm");
- let _ = repo.project_identifier();
- }
- });
- });
- Ok(Self {
- user: repo.user_config(),
- project: repo.project_config()?,
- })
- }
-}
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 4002ba786..a33a7bf61 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -18,7 +18,6 @@ mod commands;
pub(crate) mod deprecation;
mod expansion;
mod hooks;
-mod loaded;
mod project;
#[cfg(test)]
mod test;
@@ -129,7 +128,6 @@ pub use expansion::{
validate_template_syntax, vars_available_in,
};
pub use hooks::HooksConfig;
-pub use loaded::LoadedConfigs;
pub use project::{ProjectCiConfig, ProjectConfig, ProjectListConfig, valid_project_config_keys};
pub use unknown_tree::{
UnknownAnalysis, UnknownTree, UnknownWarning, collect_unknown_warnings, compute_unknown_tree,
diff --git a/src/git/repository/config.rs b/src/git/repository/config.rs
index ba6e4bf81..65a62bbc9 100644
--- a/src/git/repository/config.rs
+++ b/src/git/repository/config.rs
@@ -554,10 +554,22 @@ impl Repository {
/// Borrow the cached project configuration.
///
/// Same caching semantics as [`load_project_config`](Self::load_project_config),
- /// but returns a reference into the cache. Mirrors [`user_config`](Self::user_config)
- /// so callers that need both configs (e.g. via
- /// [`LoadedConfigs`](crate::config::LoadedConfigs)) can read them through
- /// the same borrow-from-cache shape.
+ /// but returns a reference into the cache. Mirrors
+ /// [`user_config`](Self::user_config) so callers that consume both can
+ /// pull them through the same borrow-from-cache shape.
+ ///
+ /// Unlike `user_config`, this does **not** participate in
+ /// [`Repository::prewarm`] — `.config/wt.toml` lives inside the
+ /// worktree, so the read can't fire until git discovery finishes.
+ /// Callers pay a few-tens-of-µs sequential file read on first access.
+ /// Deprecation warnings emit on that first call, so handlers that
+ /// produce ordered output (hooks, picker) typically warm this from
+ /// the entry point rather than letting it interleave with their own
+ /// stderr later.
+ ///
+ /// User and project configs are kept distinct rather than merged
+ /// because downstream consumers (alias loading, hook resolution,
+ /// approval policy) apply per-source rules.
pub fn project_config(&self) -> anyhow::Result<Option<&ProjectConfig>> {
self.cache
.project_config
diff --git a/src/git/repository/mod.rs b/src/git/repository/mod.rs
index c5a7e868a..a027cc1f6 100644
--- a/src/git/repository/mod.rs
+++ b/src/git/repository/mod.rs
@@ -251,7 +251,9 @@ pub(super) struct RepoCache {
/// Project config (loaded from .config/wt.toml in main worktree)
pub(super) project_config: OnceCell<Option<ProjectConfig>>,
/// User config (raw, as loaded from disk).
- /// Lazily loaded on first access.
+ /// Populated by [`Repository::at`] from the
+ /// [`WORKTRUNK_USER_CONFIG_PRELOAD`] preload when prewarm ran; otherwise
+ /// loaded on first access via [`Repository::user_config`].
pub(super) user_config: OnceCell<UserConfig>,
/// Resolved user config (global merged with per-project overrides, defaults applied).
/// Lazily loaded on first access via `Repository::config()`.
@@ -389,6 +391,44 @@ pub(super) static GIT_DIRS: LazyLock<DashMap<PathBuf, PathBuf>> = LazyLock::new(
pub(super) static CURRENT_BRANCHES: LazyLock<DashMap<PathBuf, Option<String>>> =
LazyLock::new(DashMap::new);
+/// Process-wide pre-parsed `git config --list -z` output, keyed by the
+/// discovery path passed to [`Repository::prewarm`].
+///
+/// Populated on the cold path by the `git config --list -z` thread spawned
+/// from [`Repository::prewarm_at`]; consumed by [`Repository::at`] when it
+/// builds a fresh `RepoCache` for that discovery path. The point is to
+/// overlap the rev-parse and config reads — the two big git invocations on
+/// the alias-dispatch critical path — so a plain `wt <alias>` pays for one
+/// git startup instead of two in series.
+///
+/// Best-effort, like the rest of `prewarm`. A failed read leaves the entry
+/// empty and the on-demand path inside [`Repository::all_config`] re-forks
+/// `git config --list -z` exactly as before.
+///
+/// Keyed by raw discovery path (no canonicalization) because the consumer in
+/// [`Repository::at`] holds the same `PathBuf` value the prewarm thread
+/// stored — both originate from `base_path()`. Test paths (`Repository::at`
+/// against tempdirs) bypass prewarm and never collide with this map.
+pub(super) static GIT_CONFIG_PRELOAD: LazyLock<
+ DashMap<PathBuf, indexmap::IndexMap<String, Vec<String>>>,
+> = LazyLock::new(DashMap::new);
+
+/// Process-wide preloaded `UserConfig` (worktrunk's user `wt.toml`),
+/// populated by [`Repository::prewarm_user_config`] from `main`.
+///
+/// [`Repository::at`] clones it into `cache.user_config` so the first
+/// `repo.user_config()` call is a memory hit, removing the ~4 ms TOML parse
+/// from the alias-dispatch critical path.
+///
+/// `OnceLock` (not `DashMap`) because `UserConfig` is process-scoped, not
+/// path-scoped: the path-derivation rule (XDG / `$WORKTRUNK_CONFIG_PATH`)
+/// doesn't change during a process lifetime.
+///
+/// Best-effort: a failed prewarm leaves the lock empty and the on-demand
+/// path inside [`Repository::user_config`] reloads from disk exactly as
+/// before.
+pub(super) static WORKTRUNK_USER_CONFIG_PRELOAD: OnceLock<UserConfig> = OnceLock::new();
+
/// Initialize the global base path for repository operations.
///
/// This should be called once at program startup from main().
@@ -465,30 +505,73 @@ impl Repository {
let discovery_path = path.into();
let git_common_dir = Self::resolve_git_common_dir(&discovery_path)?;
+ let cache = RepoCache::default();
+ // Consume any `git config --list -z` map preloaded by
+ // `Repository::prewarm` so the first `all_config()` call is a memory
+ // hit. The preload is keyed by the same `discovery_path` value that
+ // prewarm stashed under (both originate from `base_path()`); a miss
+ // (different path, no prewarm, test repo) leaves the OnceCell empty
+ // and the on-demand fork inside `all_config` runs as before.
+ if let Some(entry) = GIT_CONFIG_PRELOAD.get(&discovery_path) {
+ let _ = cache
+ .all_config
+ .set(std::sync::RwLock::new(entry.value().clone()));
+ }
+
+ // Same idea for the worktrunk-side `UserConfig`: if the prewarm
+ // thread loaded it already, clone it into the per-Repository cache so
+ // the first `repo.user_config()` call is a memory hit. A miss (no
+ // prewarm, test repo) leaves the OnceCell empty and the on-demand
+ // path in `user_config()` reloads from disk.
+ if let Some(preloaded) = WORKTRUNK_USER_CONFIG_PRELOAD.get() {
+ let _ = cache.user_config.set(preloaded.clone());
+ }
+
Ok(Self {
discovery_path,
git_common_dir,
- cache: Arc::new(RepoCache::default()),
+ cache: Arc::new(cache),
})
}
/// Eagerly populate the process-wide git-discovery caches
/// (`GIT_COMMON_DIR_CACHE`, `WORKTREE_ROOTS`, `GIT_DIRS`,
- /// `CURRENT_BRANCHES`) for the configured base path in a single
- /// `git rev-parse` fork.
+ /// `CURRENT_BRANCHES`), the git bulk-config preload
+ /// (`GIT_CONFIG_PRELOAD`), and the worktrunk user-config preload
+ /// (`WORKTRUNK_USER_CONFIG_PRELOAD`) for the configured base path.
///
/// Called once from `main` after the logger is registered, before
- /// `init_command_log` and alias dispatch. Folds the two cold-path
- /// rev-parses (`--git-common-dir` from [`Repository::at`], the
- /// `prewarm_info` batch from [`Repository::project_config_path`]) into
- /// one fork so a plain `wt <alias>` pays for one rev-parse instead of two.
- ///
- /// **Best-effort.** The merged batch reuses the existing fallbacks in
- /// `Repository::resolve_git_common_dir` and [`WorkingTree::prewarm_info`]:
- /// if it fails or partially fails, the on-demand callers re-fork and
- /// behave exactly as before. We never propagate the error from here.
- ///
- /// Two partial-success modes the batch handles:
+ /// `init_command_log` and alias dispatch. Three threads run concurrently:
+ ///
+ /// - **rev-parse thread**: a single `git rev-parse` fork that folds the
+ /// two cold-path rev-parses (`--git-common-dir` from
+ /// [`Repository::at`] and the `prewarm_info` batch from
+ /// [`Repository::project_config_path`]) into one.
+ /// - **git-config thread**: a single `git config --list -z` fork that the
+ /// bulk config map (`Repository::all_config`) would otherwise spawn
+ /// on first read.
+ /// - **user-config thread**: pure file I/O on `$WORKTRUNK_CONFIG_PATH` /
+ /// XDG paths, parsing worktrunk's user `wt.toml`. No git or
+ /// `Repository` involvement, so it overlaps cleanly with both git
+ /// forks and removes the ~4 ms TOML parse from the alias-dispatch
+ /// critical path.
+ ///
+ /// The three reads are independent: the git threads start from
+ /// `discovery_path` and let git auto-discover the repo; the user-config
+ /// thread depends only on env vars and XDG paths. Running them in
+ /// parallel saves both the second git startup (~7 ms warm, ~10 ms cold)
+ /// and the user-config TOML parse (~4 ms cold) on the alias-dispatch
+ /// critical path.
+ ///
+ /// **Best-effort.** All three threads reuse the existing fallbacks: a
+ /// failed rev-parse leaves the discovery caches empty (later
+ /// `Repository::resolve_git_common_dir` and `WorkingTree::prewarm_info`
+ /// reforks restore behaviour); a failed git-config read leaves the
+ /// preload empty (later `Repository::all_config` reforks); a failed
+ /// user-config read leaves the preload empty (later `Repository::user_config`
+ /// reloads from disk). We never propagate errors from here.
+ ///
+ /// Two partial-success modes the rev-parse batch handles:
/// - **Bare repo at the bare root**: `--show-toplevel` errors but
/// `--git-common-dir` prints first, so `GIT_COMMON_DIR_CACHE` still
/// lands. Per-worktree maps stay empty for that path — same as the
@@ -502,8 +585,10 @@ impl Repository {
/// behaviour.
///
/// Outside any work tree (`wt` invoked from a non-repo directory) the
- /// merged batch fails entirely and we cache nothing — [`Repository::at`]
- /// later runs its own rev-parse and surfaces the discovery error.
+ /// rev-parse batch and the git-config read both fail and we cache
+ /// nothing for them — [`Repository::at`] later runs its own rev-parse
+ /// and surfaces the discovery error. The user-config preload still
+ /// succeeds (it doesn't depend on the repo).
pub fn prewarm() {
Self::prewarm_at(base_path());
}
@@ -516,12 +601,47 @@ impl Repository {
// populated GIT_COMMON_DIR_CACHE via the on-demand path). Skip the
// fork — the per-worktree maps either have what we need from a prior
// prewarm/prewarm_info run, or `prewarm_info` will refork on first use.
+ // The config preloads are gated on the same key: if the rev-parse
+ // result is already cached, the git-config read either ran in a prior
+ // prewarm or will be re-forked on first `all_config` access, and the
+ // user-config preload either landed in a prior prewarm or
+ // `Repository::user_config` will reload it on demand.
if GIT_COMMON_DIR_CACHE.contains_key(discovery_path) {
return;
}
let _span = crate::trace::Span::new("prewarm");
+ // Run the rev-parse, git-config, and user-config reads concurrently
+ // on scoped threads. The two git threads target the same repo and
+ // don't depend on each other's output; the user-config thread is
+ // pure file I/O on XDG paths and doesn't touch git at all.
+ // Overlapping them removes ~one git startup (~7 ms warm, ~10 ms
+ // cold) plus the ~4 ms user-config TOML parse from the
+ // alias-dispatch critical path. Failures in any branch leave the
+ // caches empty and the on-demand callers re-fork — same
+ // best-effort contract `prewarm` always had.
+ std::thread::scope(|s| {
+ s.spawn(|| {
+ let _span = crate::trace::Span::new("prewarm_rev_parse");
+ Self::prewarm_rev_parse(discovery_path);
+ });
+ s.spawn(|| {
+ let _span = crate::trace::Span::new("prewarm_git_config");
+ Self::prewarm_git_config(discovery_path);
+ });
+ s.spawn(|| {
+ let _span = crate::trace::Span::new("prewarm_user_config");
+ Self::prewarm_user_config();
+ });
+ });
+ }
+
+ /// Rev-parse half of [`Self::prewarm_at`] — populates
+ /// `GIT_COMMON_DIR_CACHE`, `WORKTREE_ROOTS`, `GIT_DIRS`, and
+ /// `CURRENT_BRANCHES` from a single `git rev-parse` fork. See
+ /// [`Self::prewarm`] for the partial-success contract.
+ fn prewarm_rev_parse(discovery_path: &Path) {
// Order matters: `git rev-parse` emits one stdout line per selector in
// argument order, and we parse positionally. `--git-common-dir` first
// so even when later selectors fail (bare repo at the bare root, no
@@ -616,6 +736,63 @@ impl Repository {
}
}
+ /// Git-config half of [`Self::prewarm_at`] — runs `git config --list -z`
+ /// from `discovery_path` and stashes the parsed map in
+ /// [`GIT_CONFIG_PRELOAD`] for [`Repository::at`] to consume.
+ ///
+ /// Runs from `discovery_path` rather than `git_common_dir` (which we
+ /// don't know yet — the rev-parse thread is racing in parallel). Git's
+ /// `config --list` emits the same merged system + global + local config
+ /// from any path inside the repo, including linked worktrees of bare
+ /// repos: linked worktrees and the common dir share one config file, so
+ /// the merged output is identical to the existing `git_common_dir`
+ /// invocation in [`Repository::all_config`].
+ ///
+ /// Failures (non-repo directory, corrupted config) are swallowed; the
+ /// on-demand path inside `all_config` re-forks the same subprocess and
+ /// surfaces the error there.
+ fn prewarm_git_config(discovery_path: &Path) {
+ let Ok(output) = Cmd::new("git")
+ .args(["config", "--list", "-z"])
+ .current_dir(discovery_path)
+ .context(path_to_logging_context(discovery_path))
+ .run()
+ else {
+ return;
+ };
+ if !output.status.success() {
+ return;
+ }
+ let parsed = parse_config_list_z(&output.stdout);
+ GIT_CONFIG_PRELOAD.insert(discovery_path.to_path_buf(), parsed);
+ }
+
+ /// User-config half of [`Self::prewarm_at`] — loads worktrunk's user
+ /// `wt.toml` (and system + env-var layers) and stashes the result in
+ /// [`WORKTRUNK_USER_CONFIG_PRELOAD`] for [`Repository::at`] to clone
+ /// into per-Repository caches.
+ ///
+ /// Pure file I/O on `$WORKTRUNK_CONFIG_PATH` / XDG paths — no git, no
+ /// `Repository`, no dependence on `discovery_path`. Runs as a sibling
+ /// thread to the two git forks so the ~4 ms TOML parse overlaps with
+ /// them instead of falling on the alias-dispatch critical path.
+ ///
+ /// Warnings (parse failures, env-var rejections, validation issues) are
+ /// emitted to stderr inline by [`emit_user_config_warnings`], matching
+ /// the on-demand path in [`Repository::user_config`]. Prewarm runs in
+ /// `main` before alias dispatch, so these warnings emerge before any
+ /// command-specific output and before the per-handler
+ /// [`Repository::project_config`] reads that surface project-config
+ /// warnings.
+ ///
+ /// Best-effort: if `OnceLock::set` races (a second prewarm reentry, or
+ /// a test that already populated the lock) we drop the second value.
+ fn prewarm_user_config() {
+ let (config, warnings) = UserConfig::load_with_warnings();
+ emit_user_config_warnings(&warnings);
+ let _ = WORKTRUNK_USER_CONFIG_PRELOAD.set(config);
+ }
+
/// Resolved user config (global merged with per-project overrides, defaults applied).
///
/// Lazily loads `UserConfig` and resolves it using this repository's project identifier.
@@ -638,51 +815,15 @@ impl Repository {
/// Each config layer (system file, user file, env vars) degrades
/// independently — a failure in one preserves data from earlier layers.
/// Issues are surfaced on stderr so they're visible without `RUST_LOG`.
+ ///
+ /// Typically a memory hit: [`Repository::prewarm`] populates the cache
+ /// from `main` before any command runs. Tests and other callers that
+ /// bypass prewarm fall through to a fresh `UserConfig::load_with_warnings`
+ /// here.
pub fn user_config(&self) -> &UserConfig {
self.cache.user_config.get_or_init(|| {
let (config, warnings) = UserConfig::load_with_warnings();
- for warning in &warnings {
- match warning {
- LoadError::File { path, label, err } => {
- crate::styling::eprintln!(
- "{}",
- crate::styling::warning_message(format!(
- "{label} at {} failed to parse, skipping",
- crate::path::format_path_for_display(path),
- ))
- );
- crate::styling::eprintln!(
- "{}",
- crate::styling::format_with_gutter(&err.to_string(), None)
- );
- }
- LoadError::Env { err, vars } => {
- let var_list: Vec<_> = vars
- .iter()
- .map(|(name, value)| format!("{name}={value}"))
- .collect();
- crate::styling::eprintln!(
- "{}",
- crate::styling::warning_message(format!(
- "Ignoring env var overrides: {}",
- var_list.join(", ")
- ))
- );
- crate::styling::eprintln!(
- "{}",
- crate::styling::format_with_gutter(err.trim(), None)
- );
- }
- LoadError::Validation(err) => {
- crate::styling::eprintln!(
- "{}",
- crate::styling::warning_message(format!(
- "Config validation warning: {err}"
- ))
- );
- }
- }
- }
+ emit_user_config_warnings(&warnings);
config
})
}
@@ -1417,6 +1558,55 @@ fn parse_config_list_z(stdout: &[u8]) -> indexmap::IndexMap<String, Vec<String>>
map
}
+/// Emit `UserConfig::load_with_warnings` warnings to stderr.
+///
+/// Shared by [`Repository::prewarm_user_config`] (preload thread on `main`)
+/// and [`Repository::user_config`] (on-demand path for tests and callers
+/// that bypass prewarm). Both routes go through the same formatting so the
+/// stderr output is byte-identical regardless of which path runs.
+fn emit_user_config_warnings(warnings: &[LoadError]) {
+ for warning in warnings {
+ match warning {
+ LoadError::File { path, label, err } => {
+ crate::styling::eprintln!(
+ "{}",
+ crate::styling::warning_message(format!(
+ "{label} at {} failed to parse, skipping",
+ crate::path::format_path_for_display(path),
+ ))
+ );
+ crate::styling::eprintln!(
+ "{}",
+ crate::styling::format_with_gutter(&err.to_string(), None)
+ );
+ }
+ LoadError::Env { err, vars } => {
+ let var_list: Vec<_> = vars
+ .iter()
+ .map(|(name, value)| format!("{name}={value}"))
+ .collect();
+ crate::styling::eprintln!(
+ "{}",
+ crate::styling::warning_message(format!(
+ "Ignoring env var overrides: {}",
+ var_list.join(", ")
+ ))
+ );
+ crate::styling::eprintln!(
+ "{}",
+ crate::styling::format_with_gutter(err.trim(), None)
+ );
+ }
+ LoadError::Validation(err) => {
+ crate::styling::eprintln!(
+ "{}",
+ crate::styling::warning_message(format!("Config validation warning: {err}"))
+ );
+ }
+ }
+ }
+}
+
/// Parse a git boolean config value.
///
/// Accepts the forms `git config --type=bool` normalizes: `true/1/yes/on`
diff --git a/src/main.rs b/src/main.rs
index 6560f636f..fb0672d9e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1248,6 +1248,25 @@ fn handle_merge_command(args: MergeArgs, yes: bool) -> anyhow::Result<()> {
})
}
+/// True when the parsed command renders a TUI or stderr-sensitive output
+/// (a picker, statusline-on-prompt) and would be visually broken by config
+/// deprecation warnings landing on stderr above it.
+///
+/// Read from `Cli::command` before `Repository::prewarm` so the suppress
+/// latch beats `prewarm_user_config`'s warning-emission path. The handler
+/// for each of these commands also calls `suppress_warnings()` locally;
+/// both calls hit the same `OnceLock` so the second is a no-op.
+fn command_suppresses_warnings(command: Option<&Commands>) -> bool {
+ match command {
+ Some(Commands::Select { .. }) => true,
+ Some(Commands::Switch(args)) => args.branch.is_none(),
+ Some(Commands::List(args)) => {
+ matches!(args.subcommand, Some(ListSubcommand::Statusline { .. }))
+ }
+ _ => false,
+ }
+}
+
fn dispatch_command(
command: Commands,
working_dir: Option<std::path::PathBuf>,
@@ -1382,6 +1401,18 @@ fn main() {
// existing destructure pattern.
apply_global_options(directory.clone(), config);
+ // Latch warning suppression for commands whose UX is broken by stderr
+ // noise — TUI pickers (`switch` without a branch, `select`) and
+ // statusline output rendered above each shell prompt. Must fire before
+ // `Repository::prewarm` since `prewarm_user_config` loads `UserConfig`
+ // eagerly and would otherwise emit deprecation warnings before the
+ // command handler's own `suppress_warnings()` call could latch.
+ // Handlers keep their `suppress_warnings()` calls — `OnceLock` is
+ // idempotent and the local call documents the intent at the use site.
+ if command_suppresses_warnings(command.as_ref()) {
+ worktrunk::config::suppress_warnings();
+ }
+
// `init_logging` registers the logger. Run it before `init_command_log`
// so the latter's `Repository::current()` → `git rev-parse
// --git-common-dir` subprocess is visible in `[wt-trace]` output. With
diff --git a/tests/snapshots/integration__integration_tests__approvals__clear_approvals_legacy_config_storage.snap b/tests/snapshots/integration__integration_tests__approvals__clear_approvals_legacy_config_storage.snap
index eccf55fac..54f2a1190 100644
--- a/tests/snapshots/integration__integration_tests__approvals__clear_approvals_legacy_config_storage.snap
+++ b/tests/snapshots/integration__integration_tests__approvals__clear_approvals_legacy_config_storage.snap
@@ -12,10 +12,15 @@ info:
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMON_DIR: ""
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_DIR: ""
GIT_EDITOR: ""
+ GIT_INDEX_FILE: ""
+ GIT_OBJECT_DIRECTORY: ""
GIT_TERMINAL_PROMPT: "0"
+ GIT_WORK_TREE: ""
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C
@@ -45,4 +50,6 @@ exit_code: 0
----- stdout -----
----- stderr -----
+▲ User config: approved-commands under [projects] is deprecated in favor of approvals.toml
+↳ To see details, run wt config show; to apply updates, run wt config update
✓ Cleared 3 approvals for this project
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_displays_deprecation_details.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_displays_deprecation_details.snap
index 8206a8eb1..cf4dee63b 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_displays_deprecation_details.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_displays_deprecation_details.snap
@@ -81,3 +81,6 @@ exit_code: 0
○ Hyperlinks: inactive
----- stderr -----
+▲ User config: template variable repo_root is deprecated in favor of repo_path
+▲ User config: template variable main_worktree is deprecated in favor of repo
+↳ To see details, run wt config show; to apply updates, run wt config update
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_displays_no_cd_deprecation.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_displays_no_cd_deprecation.snap
index db140f9f3..f16b6a224 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_displays_no_cd_deprecation.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_displays_no_cd_deprecation.snap
@@ -79,3 +79,5 @@ exit_code: 0
○ Hyperlinks: inactive
----- stderr -----
+▲ User config: switch.no-cd is deprecated in favor of switch.cd (inverted)
+↳ To see details, run wt config show; to apply updates, run wt config update
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_displays_no_ff_deprecation.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_displays_no_ff_deprecation.snap
index 8e66716f4..1e266fdf4 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_displays_no_ff_deprecation.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_displays_no_ff_deprecation.snap
@@ -79,3 +79,5 @@ exit_code: 0
○ Hyperlinks: inactive
----- stderr -----
+▲ User config: merge.no-ff is deprecated in favor of merge.ff (inverted)
+↳ To see details, run wt config show; to apply updates, run wt config update
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_displays_project_commit_generation_deprecations.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_displays_project_commit_generation_deprecations.snap
index 3046b8edf..fdc0554ff 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_displays_project_commit_generation_deprecations.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_displays_project_commit_generation_deprecations.snap
@@ -81,3 +81,5 @@ exit_code: 0
○ Hyperlinks: inactive
----- stderr -----
+▲ User config: [projects."github.com/example/repo".commit-generation] is deprecated in favor of [projects."github.com/example/repo".commit.generation]
+↳ To see details, run wt config show; to apply updates, run wt config update
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_displays_select_section_deprecation.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_displays_select_section_deprecation.snap
index a1f98f1e6..0ead123ef 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_displays_select_section_deprecation.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_displays_select_section_deprecation.snap
@@ -79,3 +79,5 @@ exit_code: 0
○ Hyperlinks: inactive
----- stderr -----
+▲ User config: [select] is deprecated in favor of [switch.picker]
+↳ To see details, run wt config show; to apply updates, run wt config update
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_system_config.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_system_config.snap
index f8f6bd473..0fbee16b2 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_system_config.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_system_config.snap
@@ -77,3 +77,9 @@ exit_code: 0
○ Hyperlinks: inactive
----- stderr -----
+▲ System config at [PROJECT_ID] failed to parse, skipping
+  TOML parse error at line 1, column 16
+  |
+  1 | invalid = [toml
+  | ^
+  unclosed array, expected `]`
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_user_toml.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_user_toml.snap
index e3508d94f..1d23a63bd 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_user_toml.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_user_toml.snap
@@ -75,3 +75,9 @@ exit_code: 0
○ Hyperlinks: inactive
----- stderr -----
+▲ User config at ~/.config/worktrunk/config.toml failed to parse, skipping
+  TOML parse error at line 1, column 6
+  |
+  1 | this is not valid toml {{{
+  | ^
+  key with no value, expected `=`
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_project_config_for_ci.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_project_config_for_ci.snap
index 21ab9dc98..0a7257129 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_project_config_for_ci.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_project_config_for_ci.snap
@@ -84,3 +84,6 @@ exit_code: 0
○ Hyperlinks: inactive
----- stderr -----
+▲ User config: [ci] is deprecated in favor of [forge]
+↳ To see details, run wt config show; to apply updates, run wt config update
+▲ User config has key ci which belongs in project config as [forge]
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_warns_unknown_user_keys.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_warns_unknown_user_keys.snap
index ac85dafbb..2b216cbfa 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_warns_unknown_user_keys.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_warns_unknown_user_keys.snap
@@ -73,3 +73,4 @@ exit_code: 0
○ Hyperlinks: inactive
----- stderr -----
+▲ User config has unknown field commit-gen (will be ignored)
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_update_applies_approved_commands_migration.snap b/tests/snapshots/integration__integration_tests__config_show__config_update_applies_approved_commands_migration.snap
index 60abec451..941cd71f2 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_update_applies_approved_commands_migration.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_update_applies_approved_commands_migration.snap
@@ -12,10 +12,15 @@ info:
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMON_DIR: ""
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_DIR: ""
GIT_EDITOR: ""
+ GIT_INDEX_FILE: ""
+ GIT_OBJECT_DIRECTORY: ""
GIT_TERMINAL_PROMPT: "0"
+ GIT_WORK_TREE: ""
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C
@@ -46,6 +51,7 @@ exit_code: 0
----- stderr -----
▲ User config: approved-commands under [projects] is deprecated in favor of approvals.toml
+↳ To see details, run wt config show; to apply updates, run wt config update
○ Proposed diff:
  diff --git a/test-config.toml/current b/test-config.toml/migrated
  index 51f8ab1..a30ca31 100644
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_update_applies_commit_generation_migration.snap b/tests/snapshots/integration__integration_tests__config_show__config_update_applies_commit_generation_migration.snap
index 746cdf466..cdd391545 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_update_applies_commit_generation_migration.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_update_applies_commit_generation_migration.snap
@@ -12,10 +12,15 @@ info:
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMON_DIR: ""
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_DIR: ""
GIT_EDITOR: ""
+ GIT_INDEX_FILE: ""
+ GIT_OBJECT_DIRECTORY: ""
GIT_TERMINAL_PROMPT: "0"
+ GIT_WORK_TREE: ""
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C
@@ -46,6 +51,7 @@ exit_code: 0
----- stderr -----
▲ User config: [commit-generation] is deprecated in favor of [commit.generation]
+↳ To see details, run wt config show; to apply updates, run wt config update
○ Proposed diff:
  diff --git a/test-config.toml/current b/test-config.toml/migrated
  index 40d0385..bc7273c 100644
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_update_applies_template_var_migration.snap b/tests/snapshots/integration__integration_tests__config_show__config_update_applies_template_var_migration.snap
index cd3d4ff31..3b73102b0 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_update_applies_template_var_migration.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_update_applies_template_var_migration.snap
@@ -12,10 +12,15 @@ info:
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMON_DIR: ""
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_DIR: ""
GIT_EDITOR: ""
+ GIT_INDEX_FILE: ""
+ GIT_OBJECT_DIRECTORY: ""
GIT_TERMINAL_PROMPT: "0"
+ GIT_WORK_TREE: ""
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C
@@ -48,6 +53,7 @@ exit_code: 0
▲ User config: template variable repo_root is deprecated in favor of repo_path
▲ User config: template variable worktree is deprecated in favor of worktree_path
▲ User config: template variable main_worktree is deprecated in favor of repo
+↳ To see details, run wt config show; to apply updates, run wt config update
○ Proposed diff:
  diff --git a/test-config.toml/current b/test-config.toml/migrated
  index 7cc556b..b3535c5 100644
diff --git a/tests/snapshots/integration__integration_tests__config_update_pty__config_update_prompt_accept.snap b/tests/snapshots/integration__integration_tests__config_update_pty__config_update_prompt_accept.snap
index 4c275aeb6..78d1a6915 100644
--- a/tests/snapshots/integration__integration_tests__config_update_pty__config_update_prompt_accept.snap
+++ b/tests/snapshots/integration__integration_tests__config_update_pty__config_update_prompt_accept.snap
@@ -4,6 +4,7 @@ expression: "&output"
---
▲ User config: template variable repo_root is deprecated in favor of repo_path
▲ User config: template variable main_worktree is deprecated in favor of repo
+↳ To see details, run wt config show; to apply updates, run wt config update
○ Proposed diff:
  diff --git a/test-config.toml/current b/test-config.toml/migrated
  index dee4883..5eef8a6 100644
diff --git a/tests/snapshots/integration__integration_tests__config_update_pty__config_update_prompt_decline.snap b/tests/snapshots/integration__integration_tests__config_update_pty__config_update_prompt_decline.snap
index b8bb8e69e..6794b6e8c 100644
--- a/tests/snapshots/integration__integration_tests__config_update_pty__config_update_prompt_decline.snap
+++ b/tests/snapshots/integration__integration_tests__config_update_pty__config_update_prompt_decline.snap
@@ -4,6 +4,7 @@ expression: "&output"
---
▲ User config: template variable repo_root is deprecated in favor of repo_path
▲ User config: template variable main_worktree is deprecated in favor of repo
+↳ To see details, run wt config show; to apply updates, run wt config update
○ Proposed diff:
  diff --git a/test-config.toml/current b/test-config.toml/migrated
  index dee4883..5eef8a6 100644