Skip to content

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

feat(config): add copy-ignored exclude patterns (#1667)

Shun Kakinoki439d79b614f6
diff --git a/dev/config.example.toml b/dev/config.example.toml
index 1601b6018..38d31d880 100644
--- a/dev/config.example.toml
+++ b/dev/config.example.toml
@@ -118,6 +118,13 @@
# # Tasks still running when the budget expires are abandoned; 0 disables
# # timeout-ms = 500
#
+# ### Step
+#
+# [step.copy-ignored]
+# exclude = [".cache/", ".turbo/"] # Add more excludes after built-in defaults and .worktreeinclude
+#
+# Built-in excludes always apply: VCS metadata directories (`.bzr/`, `.hg/`, `.jj/`, `.pijul/`, `.sl/`, `.svn/`) and tool-state directories (`.conductor/`, `.entire/`, `.pi/`, `.worktrees/`). User config and project config exclusions are combined.
+#
# ### Aliases
#
# Command templates that run with `wt step <name>`. See `wt step` aliases (https://worktrunk.dev/step/#aliases) for usage and flags.
@@ -140,13 +147,14 @@
#
# #### Setting overrides [experimental]
#
-# Override global user config for a specific project. Scalar values (like `worktree-path`) replace the global value. Hooks and aliases append — both global and per-project versions run (global first).
+# Override global user config for a specific project. Scalar values (like `worktree-path`) replace the global value; everything else (hooks, aliases, etc.) appends, global first.
#
# [projects."github.com/user/repo"]
# worktree-path = ".worktrees/{{ branch | sanitize }}"
# list.full = true
# merge.squash = false
# pre-start.env = "cp .env.example .env"
+# step.copy-ignored.exclude = [".repo-local-cache/"]
# aliases.deploy = "make deploy BRANCH={{ branch }}"
#
# ### Custom prompt templates
diff --git a/docs/content/config.md b/docs/content/config.md
index cc103632b..5719f425b 100644
--- a/docs/content/config.md
+++ b/docs/content/config.md
@@ -208,6 +208,15 @@ no-cd = true # Skip directory change after switching (--cd to override)
# timeout-ms = 500
```
+### Step
+
+```toml
+[step.copy-ignored]
+exclude = [".cache/", ".turbo/"] # Add more excludes after built-in defaults and .worktreeinclude
+```
+
+Built-in excludes always apply: VCS metadata directories (`.bzr/`, `.hg/`, `.jj/`, `.pijul/`, `.sl/`, `.svn/`) and tool-state directories (`.conductor/`, `.entire/`, `.pi/`, `.worktrees/`). User config and project config exclusions are combined.
+
### Aliases
Command templates that run with `wt step <name>`. See [`wt step` aliases](@/step.md#aliases) for usage and flags.
@@ -232,7 +241,7 @@ Entries are keyed by project identifier (e.g., `github.com/user/repo`).
#### Setting overrides <span class="badge-experimental"></span>
-Override global user config for a specific project. Scalar values (like `worktree-path`) replace the global value. Hooks and aliases append — both global and per-project versions run (global first).
+Override global user config for a specific project. Scalar values (like `worktree-path`) replace the global value; everything else (hooks, aliases, etc.) appends, global first.
```toml
[projects."github.com/user/repo"]
@@ -240,6 +249,7 @@ worktree-path = ".worktrees/{{ branch | sanitize }}"
list.full = true
merge.squash = false
pre-start.env = "cp .env.example .env"
+step.copy-ignored.exclude = [".repo-local-cache/"]
aliases.deploy = "make deploy BRANCH={{ branch }}"
```
@@ -357,6 +367,10 @@ url = "http://localhost:{{ branch | hash_port }}"
[ci]
platform = "github" # or "gitlab"
+# Add more gitignored excludes for wt step copy-ignored
+[step.copy-ignored]
+exclude = [".cache/", ".turbo/"]
+
# Command aliases (run with wt step <name>)
[aliases]
deploy = "make deploy BRANCH={{ branch }}"
diff --git a/docs/content/step.md b/docs/content/step.md
index d2dc59f22..5a9ff8537 100644
--- a/docs/content/step.md
+++ b/docs/content/step.md
@@ -345,9 +345,9 @@ copy = "wt step copy-ignored"
### What gets copied
-All gitignored files are copied by default. Tracked files are never touched.
+All gitignored files are copied by default, except for built-in excluded directories: VCS metadata (`.bzr/`, `.hg/`, `.jj/`, `.pijul/`, `.sl/`, `.svn/`) and tool-state (`.conductor/`, `.entire/`, `.pi/`, `.worktrees/`). Tracked files are never touched.
-To limit what gets copied, create `.worktreeinclude` with gitignore-style patterns. Files must be **both** gitignored **and** in `.worktreeinclude`:
+To limit what gets copied further, create `.worktreeinclude` with gitignore-style patterns. Files must be **both** gitignored **and** in `.worktreeinclude`:
```text
# .worktreeinclude
@@ -356,6 +356,13 @@ node_modules/
target/
```
+After `.worktreeinclude` selects entries, you can add more gitignore-style excludes in user config, per-project user overrides, or project config:
+
+```toml
+[step.copy-ignored]
+exclude = [".cache/", ".turbo/"]
+```
+
### Common patterns
| Type | Patterns |
@@ -371,7 +378,7 @@ target/
- Handles nested `.gitignore` files, global excludes, and `.git/info/exclude`
- Skips existing files by default (safe to re-run)
- `--force` overwrites existing files in the destination
-- Skips `.git` entries, VCS metadata directories (`.jj`, `.hg`, etc.), and other worktrees
+- Always skips built-in excluded directories — VCS metadata (`.bzr/`, `.hg/`, `.jj/`, `.pijul/`, `.sl/`, `.svn/`) and tool-state (`.conductor/`, `.entire/`, `.pi/`, `.worktrees/`) — and nested worktrees
### Performance
diff --git a/skills/worktrunk/reference/config.md b/skills/worktrunk/reference/config.md
index 8ee266662..8bbeb993b 100644
--- a/skills/worktrunk/reference/config.md
+++ b/skills/worktrunk/reference/config.md
@@ -199,6 +199,15 @@ no-cd = true # Skip directory change after switching (--cd to override)
# timeout-ms = 500
```
+### Step
+
+```toml
+[step.copy-ignored]
+exclude = [".cache/", ".turbo/"] # Add more excludes after built-in defaults and .worktreeinclude
+```
+
+Built-in excludes always apply: VCS metadata directories (`.bzr/`, `.hg/`, `.jj/`, `.pijul/`, `.sl/`, `.svn/`) and tool-state directories (`.conductor/`, `.entire/`, `.pi/`, `.worktrees/`). User config and project config exclusions are combined.
+
### Aliases
Command templates that run with `wt step <name>`. See [`wt step` aliases](https://worktrunk.dev/step/#aliases) for usage and flags.
@@ -223,7 +232,7 @@ Entries are keyed by project identifier (e.g., `github.com/user/repo`).
#### Setting overrides [experimental]
-Override global user config for a specific project. Scalar values (like `worktree-path`) replace the global value. Hooks and aliases append — both global and per-project versions run (global first).
+Override global user config for a specific project. Scalar values (like `worktree-path`) replace the global value; everything else (hooks, aliases, etc.) appends, global first.
```toml
[projects."github.com/user/repo"]
@@ -231,6 +240,7 @@ worktree-path = ".worktrees/{{ branch | sanitize }}"
list.full = true
merge.squash = false
pre-start.env = "cp .env.example .env"
+step.copy-ignored.exclude = [".repo-local-cache/"]
aliases.deploy = "make deploy BRANCH={{ branch }}"
```
@@ -348,6 +358,10 @@ url = "http://localhost:{{ branch | hash_port }}"
[ci]
platform = "github" # or "gitlab"
+# Add more gitignored excludes for wt step copy-ignored
+[step.copy-ignored]
+exclude = [".cache/", ".turbo/"]
+
# Command aliases (run with wt step <name>)
[aliases]
deploy = "make deploy BRANCH={{ branch }}"
diff --git a/skills/worktrunk/reference/step.md b/skills/worktrunk/reference/step.md
index 1a967039c..9fdcca95e 100644
--- a/skills/worktrunk/reference/step.md
+++ b/skills/worktrunk/reference/step.md
@@ -323,9 +323,9 @@ copy = "wt step copy-ignored"
### What gets copied
-All gitignored files are copied by default. Tracked files are never touched.
+All gitignored files are copied by default, except for built-in excluded directories: VCS metadata (`.bzr/`, `.hg/`, `.jj/`, `.pijul/`, `.sl/`, `.svn/`) and tool-state (`.conductor/`, `.entire/`, `.pi/`, `.worktrees/`). Tracked files are never touched.
-To limit what gets copied, create `.worktreeinclude` with gitignore-style patterns. Files must be **both** gitignored **and** in `.worktreeinclude`:
+To limit what gets copied further, create `.worktreeinclude` with gitignore-style patterns. Files must be **both** gitignored **and** in `.worktreeinclude`:
```text
# .worktreeinclude
@@ -334,6 +334,13 @@ node_modules/
target/
```
+After `.worktreeinclude` selects entries, you can add more gitignore-style excludes in user config, per-project user overrides, or project config:
+
+```toml
+[step.copy-ignored]
+exclude = [".cache/", ".turbo/"]
+```
+
### Common patterns
| Type | Patterns |
@@ -349,7 +356,7 @@ target/
- Handles nested `.gitignore` files, global excludes, and `.git/info/exclude`
- Skips existing files by default (safe to re-run)
- `--force` overwrites existing files in the destination
-- Skips `.git` entries, VCS metadata directories (`.jj`, `.hg`, etc.), and other worktrees
+- Always skips built-in excluded directories — VCS metadata (`.bzr/`, `.hg/`, `.jj/`, `.pijul/`, `.sl/`, `.svn/`) and tool-state (`.conductor/`, `.entire/`, `.pi/`, `.worktrees/`) — and nested worktrees
### Performance
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index 3d91dcb75..c5719d30f 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -1792,6 +1792,15 @@ no-cd = true # Skip directory change after switching (--cd to override)
# timeout-ms = 500
```
+### Step
+
+```toml
+[step.copy-ignored]
+exclude = [".cache/", ".turbo/"] # Add more excludes after built-in defaults and .worktreeinclude
+```
+
+Built-in excludes always apply: VCS metadata directories (`.bzr/`, `.hg/`, `.jj/`, `.pijul/`, `.sl/`, `.svn/`) and tool-state directories (`.conductor/`, `.entire/`, `.pi/`, `.worktrees/`). User config and project config exclusions are combined.
+
### Aliases
Command templates that run with `wt step <name>`. See [`wt step` aliases](@/step.md#aliases) for usage and flags.
@@ -1816,7 +1825,7 @@ Entries are keyed by project identifier (e.g., `github.com/user/repo`).
#### Setting overrides [experimental]
-Override global user config for a specific project. Scalar values (like `worktree-path`) replace the global value. Hooks and aliases append — both global and per-project versions run (global first).
+Override global user config for a specific project. Scalar values (like `worktree-path`) replace the global value; everything else (hooks, aliases, etc.) appends, global first.
```toml
[projects."github.com/user/repo"]
@@ -1824,6 +1833,7 @@ worktree-path = ".worktrees/{{ branch | sanitize }}"
list.full = true
merge.squash = false
pre-start.env = "cp .env.example .env"
+step.copy-ignored.exclude = [".repo-local-cache/"]
aliases.deploy = "make deploy BRANCH={{ branch }}"
```
@@ -1941,6 +1951,10 @@ url = "http://localhost:{{ branch | hash_port }}"
[ci]
platform = "github" # or "gitlab"
+# Add more gitignored excludes for wt step copy-ignored
+[step.copy-ignored]
+exclude = [".cache/", ".turbo/"]
+
# Command aliases (run with wt step <name>)
[aliases]
deploy = "make deploy BRANCH={{ branch }}"
diff --git a/src/cli/step.rs b/src/cli/step.rs
index 8b62a3dfe..7fe937fdf 100644
--- a/src/cli/step.rs
+++ b/src/cli/step.rs
@@ -243,9 +243,9 @@ copy = "wt step copy-ignored"
## What gets copied
-All gitignored files are copied by default. Tracked files are never touched.
+All gitignored files are copied by default, except for built-in excluded directories: VCS metadata (`.bzr/`, `.hg/`, `.jj/`, `.pijul/`, `.sl/`, `.svn/`) and tool-state (`.conductor/`, `.entire/`, `.pi/`, `.worktrees/`). Tracked files are never touched.
-To limit what gets copied, create `.worktreeinclude` with gitignore-style patterns. Files must be **both** gitignored **and** in `.worktreeinclude`:
+To limit what gets copied further, create `.worktreeinclude` with gitignore-style patterns. Files must be **both** gitignored **and** in `.worktreeinclude`:
```text
# .worktreeinclude
@@ -254,6 +254,13 @@ node_modules/
target/
```
+After `.worktreeinclude` selects entries, you can add more gitignore-style excludes in user config, per-project user overrides, or project config:
+
+```toml
+[step.copy-ignored]
+exclude = [".cache/", ".turbo/"]
+```
+
## Common patterns
| Type | Patterns |
@@ -269,7 +276,7 @@ target/
- Handles nested `.gitignore` files, global excludes, and `.git/info/exclude`
- Skips existing files by default (safe to re-run)
- `--force` overwrites existing files in the destination
-- Skips `.git` entries, VCS metadata directories (`.jj`, `.hg`, etc.), and other worktrees
+- Always skips built-in excluded directories — VCS metadata (`.bzr/`, `.hg/`, `.jj/`, `.pijul/`, `.sl/`, `.svn/`) and tool-state (`.conductor/`, `.entire/`, `.pi/`, `.worktrees/`) — and nested worktrees
## Performance
diff --git a/src/commands/step_commands.rs b/src/commands/step_commands.rs
index 55eaaaf15..1ad57e9bf 100644
--- a/src/commands/step_commands.rs
+++ b/src/commands/step_commands.rs
@@ -21,7 +21,7 @@ use anyhow::Context;
use color_print::cformat;
use ignore::gitignore::GitignoreBuilder;
use worktrunk::HookType;
-use worktrunk::config::UserConfig;
+use worktrunk::config::{CopyIgnoredConfig, UserConfig};
use worktrunk::git::Repository;
use worktrunk::path::format_path_for_display;
use worktrunk::styling::{
@@ -559,18 +559,58 @@ pub fn step_diff(target: Option<&str>, extra_args: &[String]) -> anyhow::Result<
/// other VCS tools colocated with git need explicit exclusion.
const VCS_METADATA_DIRS: &[&str] = &[".jj", ".hg", ".svn", ".sl", ".bzr", ".pijul"];
+/// Built-in excludes for `wt step copy-ignored`: VCS metadata + tool-state directories.
+const BUILTIN_COPY_IGNORED_EXCLUDES: &[&str] = &[
+ ".bzr/",
+ ".conductor/",
+ ".entire/",
+ ".hg/",
+ ".jj/",
+ ".pi/",
+ ".pijul/",
+ ".sl/",
+ ".svn/",
+ ".worktrees/",
+];
+
+fn default_copy_ignored_excludes() -> Vec<String> {
+ BUILTIN_COPY_IGNORED_EXCLUDES
+ .iter()
+ .map(|s| (*s).to_string())
+ .collect()
+}
+
+/// Resolve the full copy-ignored config by merging built-in defaults, project
+/// config (`.config/wt.toml`), and user config (global + per-project overrides).
+fn resolve_copy_ignored_config(repo: &Repository) -> anyhow::Result<CopyIgnoredConfig> {
+ let mut config = CopyIgnoredConfig {
+ exclude: default_copy_ignored_excludes(),
+ };
+ if let Some(project_config) = repo.load_project_config()?
+ && let Some(project_copy_ignored) = project_config.copy_ignored()
+ {
+ config = config.merged_with(project_copy_ignored);
+ }
+ let user_config = UserConfig::load().context("Failed to load config")?;
+ let project_id = repo.project_identifier().ok();
+ config = config.merged_with(&user_config.copy_ignored(project_id.as_deref()));
+ Ok(config)
+}
+
/// List gitignored entries in a worktree, filtered by `.worktreeinclude` and excluding
-/// VCS metadata directories and entries that contain nested worktrees.
+/// configured patterns, VCS metadata directories, and entries that contain nested worktrees.
///
-/// Combines four steps:
+/// Combines five steps:
/// 1. `list_ignored_entries()` — git ls-files for ignored entries
/// 2. `.worktreeinclude` filtering — only matching entries if the file exists
-/// 3. VCS metadata filtering — exclude directories like `.jj`, `.hg`
-/// 4. Nested worktree filtering — exclude entries containing other worktrees
+/// 3. `[step.copy-ignored].exclude` filtering — skip entries matching configured patterns
+/// 4. VCS metadata filtering — exclude directories like `.jj`, `.hg`
+/// 5. Nested worktree filtering — exclude entries containing other worktrees
fn list_and_filter_ignored_entries(
worktree_path: &Path,
context: &str,
worktree_paths: &[PathBuf],
+ exclude_patterns: &[String],
) -> anyhow::Result<Vec<(PathBuf, bool)>> {
let ignored_entries = list_ignored_entries(worktree_path, context)?;
@@ -595,26 +635,52 @@ fn list_and_filter_ignored_entries(
ignored_entries
};
- // Filter out VCS metadata directories and entries that contain other worktrees
+ // Build exclude matcher for configured patterns (if any)
+ let exclude_matcher = if exclude_patterns.is_empty() {
+ None
+ } else {
+ let mut builder = GitignoreBuilder::new(worktree_path);
+ for pattern in exclude_patterns {
+ builder.add_line(None, pattern).map_err(|error| {
+ anyhow::anyhow!(
+ "Invalid [step.copy-ignored].exclude pattern {:?}: {}",
+ pattern,
+ error
+ )
+ })?;
+ }
+ Some(
+ builder
+ .build()
+ .context("Failed to build copy-ignored exclude matcher")?,
+ )
+ };
+
+ // Filter out excluded patterns, VCS metadata directories, and nested worktrees
Ok(filtered
.into_iter()
- .filter(|(entry_path, is_dir)| {
+ .filter(|(path, is_dir)| {
+ // Skip entries matching configured exclude patterns
+ if let Some(ref matcher) = exclude_matcher {
+ let relative = path.strip_prefix(worktree_path).unwrap_or(path.as_path());
+ if matcher.matched(relative, *is_dir).is_ignore() {
+ return false;
+ }
+ }
// Skip VCS metadata directories (.jj, .hg, etc.) — these contain
// internal state tied to a specific working directory
if *is_dir
- && entry_path
+ && path
.file_name()
.and_then(|n| n.to_str())
.is_some_and(|name| VCS_METADATA_DIRS.contains(&name))
{
return false;
}
- true
- })
- .filter(|(entry_path, _)| {
+ // Skip entries that contain other worktrees
!worktree_paths
.iter()
- .any(|wt_path| wt_path != worktree_path && wt_path.starts_with(entry_path))
+ .any(|wt_path| wt_path != worktree_path && wt_path.starts_with(path))
})
.collect())
}
@@ -633,6 +699,7 @@ pub fn step_copy_ignored(
force: bool,
) -> anyhow::Result<()> {
let repo = Repository::current()?;
+ let copy_ignored_config = resolve_copy_ignored_config(&repo)?;
// Resolve source and destination worktree paths
let (source_path, source_context) = match from {
@@ -682,8 +749,12 @@ pub fn step_copy_ignored(
.into_iter()
.map(|wt| wt.path)
.collect();
- let entries_to_copy =
- list_and_filter_ignored_entries(&source_path, &source_context, &worktree_paths)?;
+ let entries_to_copy = list_and_filter_ignored_entries(
+ &source_path,
+ &source_context,
+ &worktree_paths,
+ &copy_ignored_config.exclude,
+ )?;
if entries_to_copy.is_empty() {
eprintln!("{}", info_message("No matching files to copy"));
@@ -1236,9 +1307,11 @@ pub fn handle_promote(branch: Option<&str>) -> anyhow::Result<PromoteResult> {
// Discover gitignored entries BEFORE branch exchange — .gitignore rules belong
// to the current branch and will change after `git switch`.
let worktree_paths: Vec<PathBuf> = worktrees.iter().map(|wt| wt.path.clone()).collect();
- let main_entries = list_and_filter_ignored_entries(main_path, &main_branch, &worktree_paths)?;
+ let no_excludes: &[String] = &[];
+ let main_entries =
+ list_and_filter_ignored_entries(main_path, &main_branch, &worktree_paths, no_excludes)?;
let target_entries =
- list_and_filter_ignored_entries(target_path, &target_branch, &worktree_paths)?;
+ list_and_filter_ignored_entries(target_path, &target_branch, &worktree_paths, no_excludes)?;
// Move gitignored files to staging BEFORE branch exchange.
// `git switch` silently overwrites ignored files that collide with tracked
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 050888dc0..a9b6ac6c0 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -94,10 +94,11 @@ pub use project::{
find_unknown_keys as find_unknown_project_keys,
};
pub use user::{
- CommitConfig, CommitGenerationConfig, ListConfig, MergeConfig, OverridableConfig,
- ResolvedConfig, SelectConfig, StageMode, SwitchConfig, SwitchPickerConfig, UserConfig,
- UserProjectOverrides, config_path, default_config_path, default_system_config_path,
- find_unknown_keys as find_unknown_user_keys, set_config_path, system_config_path,
+ CommitConfig, CommitGenerationConfig, CopyIgnoredConfig, ListConfig, MergeConfig,
+ OverridableConfig, ResolvedConfig, SelectConfig, StageMode, StepConfig, SwitchConfig,
+ SwitchPickerConfig, UserConfig, UserProjectOverrides, config_path, default_config_path,
+ default_system_config_path, find_unknown_keys as find_unknown_user_keys, set_config_path,
+ system_config_path,
};
#[cfg(test)]
diff --git a/src/config/project.rs b/src/config/project.rs
index ee662c937..e34433003 100644
--- a/src/config/project.rs
+++ b/src/config/project.rs
@@ -8,8 +8,8 @@ use config::ConfigError;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
-use super::HooksConfig;
use super::commands::CommandConfig;
+use super::{CopyIgnoredConfig, HooksConfig, StepConfig};
/// Project-level configuration for `wt list` output.
///
@@ -68,6 +68,13 @@ impl ProjectConfig {
pub fn ci_platform(&self) -> Option<&str> {
self.ci.as_ref().and_then(|ci| ci.platform.as_deref())
}
+
+ /// Get `wt step copy-ignored` configuration if configured.
+ pub fn copy_ignored(&self) -> Option<&CopyIgnoredConfig> {
+ self.step
+ .as_ref()
+ .and_then(|step| step.copy_ignored.as_ref())
+ }
}
/// Project-specific configuration with hooks.
@@ -112,6 +119,10 @@ pub struct ProjectConfig {
#[serde(default)]
pub ci: Option<ProjectCiConfig>,
+ /// Configuration for `wt step` subcommands.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub step: Option<StepConfig>,
+
/// \[experimental\] Command aliases for `wt step <name>`.
///
/// Each alias maps a name to one or more command templates. All hook
@@ -298,6 +309,19 @@ url = "http://localhost:{{ branch | hash_port }}"
assert!(!list.is_configured());
}
+ #[test]
+ fn test_deserialize_step_copy_ignored() {
+ let contents = r#"
+[step.copy-ignored]
+exclude = [".conductor/", ".entire/"]
+"#;
+ let config: ProjectConfig = toml::from_str(contents).unwrap();
+ assert_eq!(
+ config.copy_ignored().unwrap().exclude,
+ vec![".conductor/".to_string(), ".entire/".to_string()]
+ );
+ }
+
// ============================================================================
// CiConfig Tests
// ============================================================================
@@ -359,6 +383,9 @@ platform = "gitlab"
let contents = r#"
post-create = "npm install"
pre-merge = "cargo test"
+
+[step.copy-ignored]
+exclude = [".conductor/"]
"#;
let keys = find_unknown_keys(contents);
assert!(keys.is_empty());
diff --git a/src/config/user/accessors.rs b/src/config/user/accessors.rs
index e68a3bbe2..75f46731b 100644
--- a/src/config/user/accessors.rs
+++ b/src/config/user/accessors.rs
@@ -12,8 +12,8 @@ use crate::config::expansion::expand_template;
use super::UserConfig;
use super::merge::{Merge, merge_optional};
use super::sections::{
- CommitConfig, CommitGenerationConfig, ListConfig, MergeConfig, SelectConfig, SwitchConfig,
- SwitchPickerConfig,
+ CommitConfig, CommitGenerationConfig, CopyIgnoredConfig, ListConfig, MergeConfig, SelectConfig,
+ StepConfig, SwitchConfig, SwitchPickerConfig,
};
/// Default worktree path template
@@ -125,6 +125,21 @@ impl UserConfig {
merge_optional(self.configs.switch.as_ref(), project_config)
}
+ /// Returns the `wt step` config for a specific project.
+ pub fn step(&self, project: Option<&str>) -> Option<StepConfig> {
+ let project_config = project
+ .and_then(|p| self.projects.get(p))
+ .and_then(|c| c.overrides.step.as_ref());
+ merge_optional(self.configs.step.as_ref(), project_config)
+ }
+
+ /// Returns the `wt step copy-ignored` config for a specific project.
+ pub fn copy_ignored(&self, project: Option<&str>) -> CopyIgnoredConfig {
+ self.step(project)
+ .and_then(|step| step.copy_ignored)
+ .unwrap_or_default()
+ }
+
/// Returns the select config for a specific project (deprecated path).
///
/// Merges project-specific settings with global settings, where project
diff --git a/src/config/user/mod.rs b/src/config/user/mod.rs
index 0aadf7e37..fe3105f01 100644
--- a/src/config/user/mod.rs
+++ b/src/config/user/mod.rs
@@ -26,8 +26,9 @@ pub use path::{
pub use resolved::ResolvedConfig;
pub use schema::{find_unknown_keys, valid_user_config_keys};
pub use sections::{
- CommitConfig, CommitGenerationConfig, ListConfig, MergeConfig, OverridableConfig, SelectConfig,
- StageMode, SwitchConfig, SwitchPickerConfig, UserProjectOverrides,
+ CommitConfig, CommitGenerationConfig, CopyIgnoredConfig, ListConfig, MergeConfig,
+ OverridableConfig, SelectConfig, StageMode, StepConfig, SwitchConfig, SwitchPickerConfig,
+ UserProjectOverrides,
};
/// User-level configuration for worktree path formatting and LLM integration.
@@ -87,7 +88,7 @@ pub struct UserConfig {
#[serde(default)]
pub projects: std::collections::BTreeMap<String, UserProjectOverrides>,
- /// Settings that can be overridden per-project (worktree-path, list, commit, merge, switch, select, hooks)
+ /// Settings that can be overridden per-project (worktree-path, list, commit, merge, switch, step, select, hooks)
#[serde(flatten, default)]
pub configs: OverridableConfig,
diff --git a/src/config/user/resolved.rs b/src/config/user/resolved.rs
index 030639584..81cc7026a 100644
--- a/src/config/user/resolved.rs
+++ b/src/config/user/resolved.rs
@@ -6,7 +6,8 @@
use super::UserConfig;
use super::sections::{
- CommitConfig, CommitGenerationConfig, ListConfig, MergeConfig, SwitchConfig, SwitchPickerConfig,
+ CommitConfig, CommitGenerationConfig, ListConfig, MergeConfig, StepConfig, SwitchConfig,
+ SwitchPickerConfig,
};
/// All resolved configuration for a specific project context.
@@ -35,6 +36,8 @@ pub struct ResolvedConfig {
pub switch_picker: SwitchPickerConfig,
/// Resolved switch config
pub switch: SwitchConfig,
+ /// Resolved `wt step` config (access copy-ignored via `step.copy_ignored()`)
+ pub step: StepConfig,
}
impl ResolvedConfig {
@@ -47,6 +50,7 @@ impl ResolvedConfig {
commit_generation: config.commit_generation(project),
switch_picker: config.switch_picker(project),
switch: config.switch(project).unwrap_or_default(),
+ step: config.step(project).unwrap_or_default(),
}
}
}
diff --git a/src/config/user/sections.rs b/src/config/user/sections.rs
index ce74bd4a1..ec4954565 100644
--- a/src/config/user/sections.rs
+++ b/src/config/user/sections.rs
@@ -8,7 +8,7 @@ use std::collections::BTreeMap;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
-use super::merge::Merge;
+use super::merge::{Merge, merge_optional};
use crate::config::HooksConfig;
use crate::config::commands::CommandConfig;
@@ -421,6 +421,59 @@ impl Merge for SwitchConfig {
}
}
+/// Configuration for `wt step copy-ignored`
+#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default, JsonSchema)]
+pub struct CopyIgnoredConfig {
+ /// Gitignore-style patterns to exclude from `wt step copy-ignored`.
+ #[serde(default, skip_serializing_if = "Vec::is_empty")]
+ pub exclude: Vec<String>,
+}
+
+impl CopyIgnoredConfig {
+ pub fn merged_with(&self, other: &Self) -> Self {
+ let mut exclude = self.exclude.clone();
+ for pattern in &other.exclude {
+ if !exclude.contains(pattern) {
+ exclude.push(pattern.clone());
+ }
+ }
+ Self { exclude }
+ }
+}
+
+impl Merge for CopyIgnoredConfig {
+ fn merge_with(&self, other: &Self) -> Self {
+ self.merged_with(other)
+ }
+}
+
+/// Configuration for `wt step` subcommands.
+#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default, JsonSchema)]
+pub struct StepConfig {
+ /// Configuration for `wt step copy-ignored`.
+ #[serde(
+ default,
+ rename = "copy-ignored",
+ skip_serializing_if = "Option::is_none"
+ )]
+ pub copy_ignored: Option<CopyIgnoredConfig>,
+}
+
+impl StepConfig {
+ /// Returns the resolved copy-ignored config, defaulting to empty if unset.
+ pub fn copy_ignored(&self) -> CopyIgnoredConfig {
+ self.copy_ignored.clone().unwrap_or_default()
+ }
+}
+
+impl Merge for StepConfig {
+ fn merge_with(&self, other: &Self) -> Self {
+ Self {
+ copy_ignored: merge_optional(self.copy_ignored.as_ref(), other.copy_ignored.as_ref()),
+ }
+ }
+}
+
/// Settings that can be set globally or per-project.
///
/// This struct is flattened into both `UserConfig` (global) and `UserProjectOverrides`
@@ -464,6 +517,10 @@ pub struct OverridableConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub switch: Option<SwitchConfig>,
+ /// Configuration for `wt step` subcommands.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub step: Option<StepConfig>,
+
/// **DEPRECATED**: Use `[switch.picker]` instead.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub select: Option<SelectConfig>,
@@ -500,6 +557,7 @@ impl OverridableConfig {
&& self.commit.is_none()
&& self.merge.is_none()
&& self.switch.is_none()
+ && self.step.is_none()
&& self.select.is_none()
&& self.aliases.is_none()
}
@@ -519,6 +577,7 @@ impl Merge for OverridableConfig {
commit: merge_optional(self.commit.as_ref(), other.commit.as_ref()),
merge: merge_optional(self.merge.as_ref(), other.merge.as_ref()),
switch: merge_optional(self.switch.as_ref(), other.switch.as_ref()),
+ step: merge_optional(self.step.as_ref(), other.step.as_ref()),
select: merge_optional(self.select.as_ref(), other.select.as_ref()),
aliases: merge_alias_maps(&self.aliases, &other.aliases), // Append semantics
}
@@ -586,7 +645,7 @@ pub struct UserProjectOverrides {
)]
pub commit_generation: Option<CommitGenerationConfig>,
- /// Per-project overrides (worktree-path, list, commit, merge, switch, select)
+ /// Per-project overrides (worktree-path, list, commit, merge, switch, step, select)
#[serde(flatten, default)]
pub overrides: OverridableConfig,
}
diff --git a/src/config/user/tests.rs b/src/config/user/tests.rs
index 9a80dca8e..1c9d076f0 100644
--- a/src/config/user/tests.rs
+++ b/src/config/user/tests.rs
@@ -97,6 +97,9 @@ stage = "all"
[merge]
squash = true
+[step.copy-ignored]
+exclude = [".conductor/"]
+
[post-create]
run = "npm install"
@@ -1582,6 +1585,42 @@ squash = false
assert_eq!(effective_merge.squash, Some(false));
}
+#[test]
+fn test_copy_ignored_config_merges_global_and_project() {
+ let project_id = "github.com/user/repo";
+ let config = UserConfig::load_from_str(
+ r#"
+[step.copy-ignored]
+exclude = [".conductor/", ".entire/"]
+
+[projects."github.com/user/repo".step.copy-ignored]
+exclude = [".repo-local/", ".entire/"]
+"#,
+ )
+ .unwrap();
+
+ let expected_global = vec![".conductor/".to_string(), ".entire/".to_string()];
+ let expected_merged = vec![
+ ".conductor/".to_string(),
+ ".entire/".to_string(),
+ ".repo-local/".to_string(),
+ ];
+
+ assert_eq!(config.copy_ignored(None).exclude, expected_global);
+ assert_eq!(
+ config.copy_ignored(Some(project_id)).exclude,
+ expected_merged.clone()
+ );
+ assert_eq!(
+ config
+ .resolved(Some(project_id))
+ .step
+ .copy_ignored()
+ .exclude,
+ expected_merged
+ );
+}
+
#[test]
fn test_deprecated_commit_generation_format_serde() {
// Test old format: [commit-generation] is still parsed for backward compatibility
@@ -2065,7 +2104,8 @@ fn test_valid_user_config_keys_all_deserialize() {
"worktree-path" => {
scalar_lines.push(format!("{key} = \"test-value\""));
}
- "list" | "commit" | "merge" | "switch" | "select" | "commit-generation" | "aliases" => {
+ "list" | "commit" | "merge" | "switch" | "step" | "select" | "commit-generation"
+ | "aliases" => {
// Table sections with minimal content
table_lines.push(format!("[{key}]"));
}
diff --git a/tests/integration_tests/step_copy_ignored.rs b/tests/integration_tests/step_copy_ignored.rs
index dd7f7fdec..4738214b3 100644
--- a/tests/integration_tests/step_copy_ignored.rs
+++ b/tests/integration_tests/step_copy_ignored.rs
@@ -4,6 +4,74 @@ use crate::common::{TestRepo, make_snapshot_cmd, make_snapshot_cmd_with_global_f
use insta_cmd::assert_cmd_snapshot;
use rstest::rstest;
use std::fs;
+use std::path::{Path, PathBuf};
+const CUSTOM_COPY_IGNORED_EXCLUDE_CONFIG: &str = r#"[step.copy-ignored]
+exclude = [".custom-cache/"]
+"#;
+
+fn run_copy_ignored(repo: &TestRepo, feature_path: &Path) -> std::process::Output {
+ let output = repo
+ .wt_command()
+ .args(["step", "copy-ignored"])
+ .current_dir(feature_path)
+ .output()
+ .unwrap();
+
+ assert!(
+ output.status.success(),
+ "copy-ignored should succeed: {}",
+ String::from_utf8_lossy(&output.stderr)
+ );
+ output
+}
+
+fn run_copy_ignored_single_entry(repo: &TestRepo, feature_path: &Path) {
+ let output = run_copy_ignored(repo, feature_path);
+ assert!(
+ String::from_utf8_lossy(&output.stderr).contains("Copied 1 entry"),
+ "expected one copied entry: {}",
+ String::from_utf8_lossy(&output.stderr)
+ );
+}
+
+fn write_worktree_project_config(worktree_path: &Path, contents: &str) {
+ let config_dir = worktree_path.join(".config");
+ fs::create_dir_all(&config_dir).unwrap();
+ fs::write(config_dir.join("wt.toml"), contents).unwrap();
+}
+
+fn assert_copy_ignored_excluded(feature_path: &Path, excluded_dirs: &[&str], source: &str) {
+ assert!(
+ feature_path.join(".env").exists(),
+ ".env should still be copied"
+ );
+ for excluded_dir in excluded_dirs {
+ assert!(
+ !feature_path.join(excluded_dir).exists(),
+ "{} should be excluded by {}",
+ excluded_dir,
+ source
+ );
+ }
+}
+
+fn setup_copy_ignored_exclude_fixture(repo: &mut TestRepo) -> PathBuf {
+ let feature_path = repo.add_worktree("feature");
+
+ let ignored_entries = ".env\n.custom-cache/\n";
+
+ fs::create_dir_all(repo.root_path().join(".custom-cache")).unwrap();
+ fs::write(repo.root_path().join(".env"), "SECRET=value").unwrap();
+ fs::write(
+ repo.root_path().join(".custom-cache").join("state.json"),
+ "{}",
+ )
+ .unwrap();
+ fs::write(repo.root_path().join(".gitignore"), ignored_entries).unwrap();
+ fs::write(repo.root_path().join(".worktreeinclude"), ignored_entries).unwrap();
+
+ feature_path
+}
/// Test with no .worktreeinclude file and no gitignored files
#[rstest]
@@ -47,6 +115,49 @@ fn test_copy_ignored_default_copies_all(mut repo: TestRepo) {
);
}
+#[rstest]
+fn test_copy_ignored_excludes_project_config(mut repo: TestRepo) {
+ let feature_path = setup_copy_ignored_exclude_fixture(&mut repo);
+ repo.write_project_config(CUSTOM_COPY_IGNORED_EXCLUDE_CONFIG);
+ write_worktree_project_config(&feature_path, CUSTOM_COPY_IGNORED_EXCLUDE_CONFIG);
+
+ run_copy_ignored_single_entry(&repo, &feature_path);
+
+ assert_copy_ignored_excluded(&feature_path, &[".custom-cache"], "project config");
+}
+
+#[rstest]
+fn test_copy_ignored_excludes_user_config(mut repo: TestRepo) {
+ let feature_path = setup_copy_ignored_exclude_fixture(&mut repo);
+ repo.write_test_config(CUSTOM_COPY_IGNORED_EXCLUDE_CONFIG);
+
+ run_copy_ignored_single_entry(&repo, &feature_path);
+
+ assert_copy_ignored_excluded(&feature_path, &[".custom-cache"], "user config");
+}
+
+#[rstest]
+fn test_copy_ignored_skips_built_in_excluded_dirs(mut repo: TestRepo) {
+ let feature_path = repo.add_worktree("feature");
+ let ignored_entries = ".conductor/\n.entire/\n.pi/\n.env\n";
+
+ for dir in [".conductor", ".entire", ".pi"] {
+ fs::create_dir_all(repo.root_path().join(dir)).unwrap();
+ fs::write(repo.root_path().join(dir).join("state.json"), dir).unwrap();
+ }
+ fs::write(repo.root_path().join(".env"), "SECRET=value").unwrap();
+ fs::write(repo.root_path().join(".gitignore"), ignored_entries).unwrap();
+ fs::write(repo.root_path().join(".worktreeinclude"), ignored_entries).unwrap();
+
+ run_copy_ignored_single_entry(&repo, &feature_path);
+
+ assert_copy_ignored_excluded(
+ &feature_path,
+ &[".conductor", ".entire", ".pi"],
+ "built-in excludes",
+ );
+}
+
/// Test error handling when .worktreeinclude has invalid syntax
#[rstest]
fn test_copy_ignored_invalid_worktreeinclude(mut repo: TestRepo) {
@@ -117,12 +228,7 @@ fn test_copy_ignored_basic(mut repo: TestRepo) {
fs::write(repo.root_path().join(".worktreeinclude"), ".env\n").unwrap();
// Run from feature worktree
- assert_cmd_snapshot!(make_snapshot_cmd(
- &repo,
- "step",
- &["copy-ignored"],
- Some(&feature_path),
- ));
+ run_copy_ignored(&repo, &feature_path);
// Verify file was copied
let copied_env = feature_path.join(".env");
@@ -148,24 +254,8 @@ fn test_copy_ignored_idempotent(mut repo: TestRepo) {
fs::write(repo.root_path().join(".worktreeinclude"), ".env\n").unwrap();
// Run copy-ignored twice - second run should succeed (skip existing)
- let output1 = repo
- .wt_command()
- .args(["step", "copy-ignored"])
- .current_dir(&feature_path)
- .output()
- .unwrap();
- assert!(output1.status.success(), "First copy should succeed");
-
- let output2 = repo
- .wt_command()
- .args(["step", "copy-ignored"])
- .current_dir(&feature_path)
- .output()
- .unwrap();
- assert!(
- output2.status.success(),
- "Second copy should succeed (idempotent)"
- );
+ run_copy_ignored(&repo, &feature_path);
+ run_copy_ignored(&repo, &feature_path);
// File should still exist with original content
assert_eq!(
@@ -256,12 +346,7 @@ fn test_copy_ignored_directory(mut repo: TestRepo) {
fs::write(repo.root_path().join(".worktreeinclude"), "target/\n").unwrap();
// Run from feature worktree
- assert_cmd_snapshot!(make_snapshot_cmd(
- &repo,
- "step",
- &["copy-ignored"],
- Some(&feature_path),
- ));
+ run_copy_ignored(&repo, &feature_path);
// Verify directory was copied with contents
let copied_target = feature_path.join("target");
@@ -292,12 +377,7 @@ fn test_copy_ignored_glob_pattern(mut repo: TestRepo) {
// .worktreeinclude with same pattern
fs::write(repo.root_path().join(".worktreeinclude"), ".env*\n").unwrap();
- assert_cmd_snapshot!(make_snapshot_cmd(
- &repo,
- "step",
- &["copy-ignored"],
- Some(&feature_path),
- ));
+ run_copy_ignored(&repo, &feature_path);
// Verify all were copied
assert!(feature_path.join(".env").exists());
@@ -401,12 +481,7 @@ fn test_copy_ignored_deep_pattern(mut repo: TestRepo) {
)
.unwrap();
- assert_cmd_snapshot!(make_snapshot_cmd(
- &repo,
- "step",
- &["copy-ignored"],
- Some(&feature_path),
- ));
+ run_copy_ignored(&repo, &feature_path);
// Verify the nested file was copied
assert!(
@@ -439,12 +514,7 @@ fn test_copy_ignored_nested_gitignore(mut repo: TestRepo) {
)
.unwrap();
- assert_cmd_snapshot!(make_snapshot_cmd(
- &repo,
- "step",
- &["copy-ignored"],
- Some(&feature_path),
- ));
+ run_copy_ignored(&repo, &feature_path);
// Verify the file was copied (nested .gitignore was respected)
assert!(
@@ -542,12 +612,7 @@ fn test_copy_ignored_no_default_branch_worktree(mut repo: TestRepo) {
fs::write(repo.root_path().join(".worktreeinclude"), ".env\n").unwrap();
// Copy from feature - should use main worktree as source (primary_worktree fallback)
- assert_cmd_snapshot!(make_snapshot_cmd(
- &repo,
- "step",
- &["copy-ignored"],
- Some(&feature_path),
- ));
+ run_copy_ignored(&repo, &feature_path);
// Verify file was copied from main worktree
assert!(
@@ -1186,12 +1251,7 @@ fn test_copy_ignored_skips_vcs_metadata_dirs(mut repo: TestRepo) {
fs::write(repo.root_path().join(".gitignore"), ".jj/\n.hg/\n.env\n").unwrap();
// Run copy-ignored
- assert_cmd_snapshot!(make_snapshot_cmd(
- &repo,
- "step",
- &["copy-ignored"],
- Some(&feature_path),
- ));
+ run_copy_ignored(&repo, &feature_path);
// Verify: .env was copied (regular ignored file)
assert!(
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_create.snap b/tests/snapshots/integration__integration_tests__help__help_config_create.snap
index 8ee37bc52..9855849ce 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_create.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_create.snap
@@ -177,6 +177,13 @@ Creates ~/.config/worktrunk/config.toml with the following content:
  # # Tasks still running when the budget expires are abandoned; 0 disables
  # # timeout-ms = 500
  #
+  # ### Step
+  #
+  # [step.copy-ignored]
+  # exclude = [".cache/", ".turbo/"] # Add more excludes after built-in defaults and .worktreeinclude
+  #
+  # Built-in excludes always apply: VCS metadata directories (`.bzr/`, `.hg/`, `.jj/`, `.pijul/`, `.sl/`, `.svn/`) and tool-state directories (`.conductor/`, `.entire/`, `.pi/`, `.worktrees/`). User config and project config exclusions are combined.
+  #
  # ### Aliases
  #
  # Command templates that run with `wt step <name>`. See `wt step` aliases (https://worktrunk.dev/step/#aliases) for usage and flags.
@@ -199,13 +206,14 @@ Creates ~/.config/worktrunk/config.toml with the following content:
  #
  # #### Setting overrides [experimental]
  #
-  # Override global user config for a specific project. Scalar values (like `worktree-path`) replace the global value. Hooks and aliases append — both global and per-project versions run (global first).
+  # Override global user config for a specific project. Scalar values (like `worktree-path`) replace the global value; everything else (hooks, aliases, etc.) appends, global first.
  #
  # [projects."github.com/user/repo"]
  # worktree-path = ".worktrees/{{ branch | sanitize }}"
  # list.full = true
  # merge.squash = false
  # pre-start.env = "cp .env.example .env"
+  # step.copy-ignored.exclude = [".repo-local-cache/"]
  # aliases.deploy = "make deploy BRANCH={{ branch }}"
  #
  # ### Custom prompt templates
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_long.snap b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
index 02aa2707a..f249aa84c 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
@@ -222,6 +222,13 @@ Most flags are on by default. Set to false to change default behavior.
  # Tasks still running when the budget expires are abandoned; 0 disables
  # timeout-ms = 500
+Step
+
+  [step.copy-ignored]
+  exclude = [".cache/", ".turbo/"] # Add more excludes after built-in defaults and .worktreeinclude
+
+Built-in excludes always apply: VCS metadata directories (.bzr/, .hg/, .jj/, .pijul/, .sl/, .svn/) and tool-state directories (.conductor/, .entire/, .pi/, .worktrees/). User config and project config exclusions are combined.
+
Aliases
Command templates that run with wt step <name>. See wt step aliases for usage and flags.
@@ -244,13 +251,14 @@ Entries are keyed by project identifier (e.g., github.com/user/repo).
Setting overrides [experimental]
-Override global user config for a specific project. Scalar values (like worktree-path) replace the global value. Hooks and aliases append — both global and per-project versions run (global first).
+Override global user config for a specific project. Scalar values (like worktree-path) replace the global value; everything else (hooks, aliases, etc.) appends, global first.
  [projects."github.com/user/repo"]
  worktree-path = ".worktrees/{{ branch | sanitize }}"
  list.full = true
  merge.squash = false
  pre-start.env = "cp .env.example .env"
+  step.copy-ignored.exclude = [".repo-local-cache/"]
  aliases.deploy = "make deploy BRANCH={{ branch }}"
Custom prompt templates
@@ -357,6 +365,10 @@ See wt hook for hook types, execution order, template variables, and exa
  [ci]
  platform = "github" # or "gitlab"
 
+  # Add more gitignored excludes for wt step copy-ignored
+  [step.copy-ignored]
+  exclude = [".cache/", ".turbo/"]
+ 
  # Command aliases (run with wt step <name>)
  [aliases]
  deploy = "make deploy BRANCH={{ branch }}"
diff --git a/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_basic.snap b/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_basic.snap
deleted file mode 100644
index c4f2e0705..000000000
--- a/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_basic.snap
+++ /dev/null
@@ -1,41 +0,0 @@
----
-source: tests/integration_tests/step_copy_ignored.rs
-info:
- program: wt
- args:
- - step
- - copy-ignored
- env:
- APPDATA: "[TEST_CONFIG_HOME]"
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- GIT_TERMINAL_PROMPT: "0"
- HOME: "[TEST_HOME]"
- LANG: C
- LC_ALL: C
- MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
- PATH: "[PATH]"
- PSModulePath: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- USERPROFILE: "[TEST_HOME]"
- WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
- WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
- WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
- WORKTRUNK_TEST_EPOCH: "1735776000"
- WORKTRUNK_TEST_POWERSHELL_ENV: "0"
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-✓ Copied 1 entry
diff --git a/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_deep_pattern.snap b/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_deep_pattern.snap
deleted file mode 100644
index c4f2e0705..000000000
--- a/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_deep_pattern.snap
+++ /dev/null
@@ -1,41 +0,0 @@
----
-source: tests/integration_tests/step_copy_ignored.rs
-info:
- program: wt
- args:
- - step
- - copy-ignored
- env:
- APPDATA: "[TEST_CONFIG_HOME]"
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- GIT_TERMINAL_PROMPT: "0"
- HOME: "[TEST_HOME]"
- LANG: C
- LC_ALL: C
- MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
- PATH: "[PATH]"
- PSModulePath: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- USERPROFILE: "[TEST_HOME]"
- WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
- WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
- WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
- WORKTRUNK_TEST_EPOCH: "1735776000"
- WORKTRUNK_TEST_POWERSHELL_ENV: "0"
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-✓ Copied 1 entry
diff --git a/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_directory.snap b/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_directory.snap
deleted file mode 100644
index c4f2e0705..000000000
--- a/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_directory.snap
+++ /dev/null
@@ -1,41 +0,0 @@
----
-source: tests/integration_tests/step_copy_ignored.rs
-info:
- program: wt
- args:
- - step
- - copy-ignored
- env:
- APPDATA: "[TEST_CONFIG_HOME]"
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- GIT_TERMINAL_PROMPT: "0"
- HOME: "[TEST_HOME]"
- LANG: C
- LC_ALL: C
- MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
- PATH: "[PATH]"
- PSModulePath: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- USERPROFILE: "[TEST_HOME]"
- WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
- WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
- WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
- WORKTRUNK_TEST_EPOCH: "1735776000"
- WORKTRUNK_TEST_POWERSHELL_ENV: "0"
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-✓ Copied 1 entry
diff --git a/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_glob_pattern.snap b/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_glob_pattern.snap
deleted file mode 100644
index 283cd208f..000000000
--- a/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_glob_pattern.snap
+++ /dev/null
@@ -1,41 +0,0 @@
----
-source: tests/integration_tests/step_copy_ignored.rs
-info:
- program: wt
- args:
- - step
- - copy-ignored
- env:
- APPDATA: "[TEST_CONFIG_HOME]"
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- GIT_TERMINAL_PROMPT: "0"
- HOME: "[TEST_HOME]"
- LANG: C
- LC_ALL: C
- MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
- PATH: "[PATH]"
- PSModulePath: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- USERPROFILE: "[TEST_HOME]"
- WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
- WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
- WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
- WORKTRUNK_TEST_EPOCH: "1735776000"
- WORKTRUNK_TEST_POWERSHELL_ENV: "0"
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-✓ Copied 3 entries
diff --git a/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_nested_gitignore.snap b/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_nested_gitignore.snap
deleted file mode 100644
index c4f2e0705..000000000
--- a/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_nested_gitignore.snap
+++ /dev/null
@@ -1,41 +0,0 @@
----
-source: tests/integration_tests/step_copy_ignored.rs
-info:
- program: wt
- args:
- - step
- - copy-ignored
- env:
- APPDATA: "[TEST_CONFIG_HOME]"
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- GIT_TERMINAL_PROMPT: "0"
- HOME: "[TEST_HOME]"
- LANG: C
- LC_ALL: C
- MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
- PATH: "[PATH]"
- PSModulePath: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- USERPROFILE: "[TEST_HOME]"
- WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
- WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
- WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
- WORKTRUNK_TEST_EPOCH: "1735776000"
- WORKTRUNK_TEST_POWERSHELL_ENV: "0"
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-✓ Copied 1 entry
diff --git a/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_no_default_branch_worktree.snap b/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_no_default_branch_worktree.snap
deleted file mode 100644
index c4f2e0705..000000000
--- a/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_no_default_branch_worktree.snap
+++ /dev/null
@@ -1,41 +0,0 @@
----
-source: tests/integration_tests/step_copy_ignored.rs
-info:
- program: wt
- args:
- - step
- - copy-ignored
- env:
- APPDATA: "[TEST_CONFIG_HOME]"
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- GIT_TERMINAL_PROMPT: "0"
- HOME: "[TEST_HOME]"
- LANG: C
- LC_ALL: C
- MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
- PATH: "[PATH]"
- PSModulePath: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- USERPROFILE: "[TEST_HOME]"
- WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
- WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
- WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
- WORKTRUNK_TEST_EPOCH: "1735776000"
- WORKTRUNK_TEST_POWERSHELL_ENV: "0"
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-✓ Copied 1 entry
diff --git a/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_skips_vcs_metadata_dirs.snap b/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_skips_vcs_metadata_dirs.snap
deleted file mode 100644
index 8c3590561..000000000
--- a/tests/snapshots/integration__integration_tests__step_copy_ignored__copy_ignored_skips_vcs_metadata_dirs.snap
+++ /dev/null
@@ -1,45 +0,0 @@
----
-source: tests/integration_tests/step_copy_ignored.rs
-info:
- program: wt
- args:
- - step
- - copy-ignored
- env:
- APPDATA: "[TEST_CONFIG_HOME]"
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- GIT_TERMINAL_PROMPT: "0"
- HOME: "[TEST_HOME]"
- LANG: C
- LC_ALL: C
- MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
- NO_COLOR: ""
- PATH: "[PATH]"
- PSModulePath: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- USERPROFILE: "[TEST_HOME]"
- WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
- WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
- WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
- WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
- WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
- WORKTRUNK_TEST_EPOCH: "1735776000"
- WORKTRUNK_TEST_NUSHELL_ENV: "0"
- WORKTRUNK_TEST_POWERSHELL_ENV: "0"
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-✓ Copied 1 entry