Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Replace --force flag with --yes throughout codebase
Maximilian Roosc1ea17d1b403
diff --git a/.claude/skills/release/SKILL.md b/.claude/skills/release/SKILL.mdindex e741e773c..aa74936bf 100644--- a/.claude/skills/release/SKILL.md+++ b/.claude/skills/release/SKILL.md@@ -7,7 +7,7 @@ description: Worktrunk release workflow. Use when user asks to "do a release", "## Steps-1. **Run tests**: `cargo run -- hook pre-merge --force`+1. **Run tests**: `cargo run -- hook pre-merge --yes`2. **Check current version**: Read `version` in `Cargo.toml`3. **Review commits**: Check commits since last release to understand scope of changes4. **Credit contributors**: Check for external contributors with `git log v<last-version>..HEAD --format="%an <%ae>" | sort -u` and credit them in changelog entries (see below)diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yamlindex 1f7ddb481..ee452655c 100644--- a/.github/workflows/ci.yaml+++ b/.github/workflows/ci.yaml@@ -96,7 +96,7 @@ jobs:crate: worktrunk- name: 🧪 Pre-merge hooks- run: wt hook pre-merge --force+ run: wt hook pre-merge --yes# Check if Cargo files changed (for conditional jobs below)changes:diff --git a/CLAUDE.md b/CLAUDE.mdindex dcf10ea02..c8b005fac 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -57,7 +57,7 @@ Avoid mixing: "main/default branch worktree" is confusing. Use "main worktree" f```bash# Run all tests + lints (recommended before committing)-cargo run -- hook pre-merge --force+cargo run -- hook pre-merge --yes```The pre-merge hook runs lints and the full test suite.@@ -108,7 +108,7 @@ PTY-based tests (approval prompts, TUI select, progressive rendering, shell wrapNEXTEST_NO_INPUT_HANDLER=1 cargo nextest run --features shell-integration-tests```-The pre-merge hook (`wt hook pre-merge --force`) already sets `NEXTEST_NO_INPUT_HANDLER=1` automatically. See `tests/common/mod.rs` for technical details on the SIGTTOU issue.+The pre-merge hook (`wt hook pre-merge --yes`) already sets `NEXTEST_NO_INPUT_HANDLER=1` automatically. See `tests/common/mod.rs` for technical details on the SIGTTOU issue.## Command Execution Principlesdiff --git a/docs/demos/shared/lib.py b/docs/demos/shared/lib.pyindex ee1518b1d..5e5ea5d09 100644--- a/docs/demos/shared/lib.py+++ b/docs/demos/shared/lib.py@@ -421,7 +421,7 @@ endwt_bin = repo_root / "target" / "debug" / "wt"install_env = os.environ.copy()install_env["HOME"] = str(env.home)- run([str(wt_bin), "config", "shell", "install", "fish", "--force"], env=install_env)+ run([str(wt_bin), "config", "shell", "install", "fish", "--yes"], env=install_env)def setup_mock_clis(env: DemoEnv) -> None:diff --git a/tests/integration_tests/approval_save.rs b/tests/integration_tests/approval_save.rsindex 0ccfb3f5b..067559009 100644--- a/tests/integration_tests/approval_save.rs+++ b/tests/integration_tests/approval_save.rs@@ -209,13 +209,13 @@ fn test_isolated_config_safety() {assert!(isolated_content.contains("THIS SHOULD NOT APPEAR IN USER CONFIG"));}-/// Test that --force flag does NOT save approvals+/// Test that --yes flag does NOT save approvals///-/// The --force flag should allow commands to run once without saving them-/// to the config file. This ensures --force is a one-time bypass, not a+/// The --yes flag should allow commands to run once without saving them+/// to the config file. This ensures --yes is a one-time bypass, not a/// permanent approval.#[test]-fn test_force_flag_does_not_save_approval() {+fn test_yes_flag_does_not_save_approval() {let temp_dir = TempDir::new().unwrap();let config_path = temp_dir.path().join("config.toml");@@ -223,8 +223,8 @@ fn test_force_flag_does_not_save_approval() {let initial_config = WorktrunkConfig::default();initial_config.save_to(&config_path).unwrap();- // When using --force, the approval is NOT saved to config- // This is the correct behavior - force is a one-time bypass+ // When using --yes, the approval is NOT saved to config+ // This is the correct behavior - yes is a one-time bypass// So we just verify the initial config is unchanged// Load the config and verify it's still empty (no approvals added)@@ -239,7 +239,7 @@ fn test_force_flag_does_not_save_approval() {/// Test that approval saving logic handles missing config gracefully#[test]-fn test_force_flag_saves_to_new_config_file() {+fn test_approval_saves_to_new_config_file() {let temp_dir = TempDir::new().unwrap();let config_dir = temp_dir.path().join("nested").join("config");let config_path = config_dir.join("config.toml");diff --git a/tests/integration_tests/approval_ui.rs b/tests/integration_tests/approval_ui.rsindex d2d311468..2c64363b0 100644--- a/tests/integration_tests/approval_ui.rs+++ b/tests/integration_tests/approval_ui.rs@@ -106,33 +106,32 @@ approved-commands = ["echo 'Second command'"]}#[rstest]-fn test_force_flag_does_not_save_approvals(repo: TestRepo) {+fn test_yes_flag_does_not_save_approvals(repo: TestRepo) {repo.write_project_config(r#"post-create = "echo 'test command' > output.txt""#);repo.commit("Add config");- // Run with --force+ // Run with --yeslet settings = setup_snapshot_settings(&repo);settings.bind(|| {- let mut cmd =- make_snapshot_cmd(&repo, "switch", &["--create", "test-force", "--yes"], None);- assert_cmd_snapshot!("force_does_not_save_approvals_first_run", cmd);+ let mut cmd = make_snapshot_cmd(&repo, "switch", &["--create", "test-yes", "--yes"], None);+ assert_cmd_snapshot!("yes_does_not_save_approvals_first_run", cmd);});// Clean up the worktreelet mut cmd = Command::new(insta_cmd::get_cargo_bin("wt"));repo.clean_cli_env(&mut cmd);cmd.arg("remove")- .arg("test-force")+ .arg("test-yes").arg("--yes").current_dir(repo.root_path());cmd.output().unwrap();- // Run again WITHOUT --force - should prompt+ // Run again WITHOUT --yes - should promptsnapshot_approval(- "force_does_not_save_approvals_second_run",+ "yes_does_not_save_approvals_second_run",&repo,- &["--create", "test-force-2"],+ &["--create", "test-yes-2"],false,);}@@ -288,7 +287,7 @@ fn test_run_hook_post_merge_requires_approval(repo: TestRepo) {/// Test that approval fails in non-TTY environment with clear error message////// When stdin is not a TTY (e.g., CI/CD, piped input), approval prompts cannot be shown.-/// The command should fail with a clear error telling users to use --force.+/// The command should fail with a clear error telling users to use --yes.#[rstest]fn test_approval_fails_in_non_tty(repo: TestRepo) {repo.write_project_config(r#"post-create = "echo 'test command'""#);@@ -303,24 +302,24 @@ fn test_approval_fails_in_non_tty(repo: TestRepo) {});}-/// Test that --force flag bypasses TTY requirement+/// Test that --yes flag bypasses TTY requirement///-/// Even in non-TTY environments, --force should allow commands to execute.+/// Even in non-TTY environments, --yes should allow commands to execute.#[rstest]-fn test_force_bypasses_tty_check(repo: TestRepo) {+fn test_yes_bypasses_tty_check(repo: TestRepo) {repo.write_project_config(r#"post-create = "echo 'test command'""#);repo.commit("Add config");- // Run with --force to bypass approval entirely+ // Run with --yes to bypass approval entirelylet settings = setup_snapshot_settings(&repo);settings.bind(|| {let mut cmd = make_snapshot_cmd(&repo,"switch",- &["--create", "test-force-tty", "--yes"],+ &["--create", "test-yes-tty", "--yes"],None,);- assert_cmd_snapshot!("force_bypasses_tty_check", cmd);+ assert_cmd_snapshot!("yes_bypasses_tty_check", cmd);});}@@ -340,7 +339,7 @@ fn test_hook_post_merge_target_is_current_branch(repo: TestRepo) {.output().unwrap();- // Run the hook with --force to skip approval+ // Run the hook with --yes to skip approvallet output = Command::new(env!("CARGO_BIN_EXE_wt")).args(["hook", "post-merge", "--yes"]).current_dir(repo.root_path())@@ -377,7 +376,7 @@ fn test_hook_pre_merge_target_is_current_branch(repo: TestRepo) {.output().unwrap();- // Run the hook with --force to skip approval+ // Run the hook with --yes to skip approvallet output = Command::new(env!("CARGO_BIN_EXE_wt")).args(["hook", "pre-merge", "--yes"]).current_dir(repo.root_path())@@ -415,7 +414,7 @@ build = "echo 'running build' > build.txt");repo.commit("Add pre-merge hooks");- // Run only the "lint" command with --force to skip approval+ // Run only the "lint" command with --yes to skip approvallet output = Command::new(env!("CARGO_BIN_EXE_wt")).args(["hook", "pre-merge", "lint", "--yes"]).current_dir(repo.root_path())diff --git a/tests/integration_tests/configure_shell.rs b/tests/integration_tests/configure_shell.rsindex ce717e69d..04536ff1a 100644--- a/tests/integration_tests/configure_shell.rs+++ b/tests/integration_tests/configure_shell.rs@@ -6,7 +6,7 @@ use rstest::rstest;use std::fs;use tempfile::TempDir;-/// Test `wt config shell install` with --force flag (skips confirmation)+/// Test `wt config shell install` with --yes flag (skips confirmation)#[rstest]fn test_configure_shell_with_yes(repo: TestRepo, temp_home: TempDir) {// Create a fake .zshrc filediff --git a/tests/integration_tests/merge.rs b/tests/integration_tests/merge.rsindex 15de34198..bb633a6dc 100644--- a/tests/integration_tests/merge.rs+++ b/tests/integration_tests/merge.rs@@ -599,7 +599,7 @@ fn test_merge_pre_merge_command_success(mut repo: TestRepo) {repo.add_main_worktree();let feature_wt = repo.add_feature();- // Merge with --force to skip approval prompts+ // Merge with --yes to skip approval promptssnapshot_merge("merge_pre_merge_command_success",&repo,@@ -621,7 +621,7 @@ fn test_merge_pre_merge_command_failure(mut repo: TestRepo) {repo.add_main_worktree();let feature_wt = repo.add_feature();- // Merge with --force - pre-merge command should fail and block merge+ // Merge with --yes - pre-merge command should fail and block mergesnapshot_merge("merge_pre_merge_command_failure",&repo,@@ -674,7 +674,7 @@ test = "exit 0"repo.add_main_worktree();let feature_wt = repo.add_feature();- // Merge with --force - all pre-merge commands should pass+ // Merge with --yes - all pre-merge commands should passsnapshot_merge("merge_pre_merge_command_named",&repo,@@ -700,7 +700,7 @@ fn test_merge_post_merge_command_success(mut repo: TestRepo) {repo.add_main_worktree();let feature_wt = repo.add_feature();- // Merge with --force+ // Merge with --yessnapshot_merge("merge_post_merge_command_success",&repo,@@ -768,7 +768,7 @@ fn test_merge_post_merge_command_failure(mut repo: TestRepo) {repo.add_main_worktree();let feature_wt = repo.add_feature();- // Merge with --force - post-merge command should fail but merge should complete+ // Merge with --yes - post-merge command should fail but merge should completesnapshot_merge("merge_post_merge_command_failure",&repo,@@ -798,7 +798,7 @@ deploy = "echo 'Deploying branch {{ branch }}' > deploy.txt"repo.add_main_worktree();let feature_wt = repo.add_feature();- // Merge with --force+ // Merge with --yessnapshot_merge("merge_post_merge_command_named",&repo,@@ -840,7 +840,7 @@ fn test_merge_post_merge_runs_with_nothing_to_merge(mut repo: TestRepo) {// Create a feature worktree with NO commits (already up-to-date with main)let feature_wt = repo.add_worktree("feature");- // Merge with --force - nothing to merge but post-merge should still run+ // Merge with --yes - nothing to merge but post-merge should still runsnapshot_merge("merge_post_merge_runs_with_nothing_to_merge",&repo,@@ -907,7 +907,7 @@ fn test_merge_pre_commit_command_success(mut repo: TestRepo) {let feature_wt = repo.add_worktree("feature");fs::write(feature_wt.join("feature.txt"), "feature content").unwrap();- // Merge with --force (changes uncommitted, should trigger pre-commit hook)+ // Merge with --yes (changes uncommitted, should trigger pre-commit hook)snapshot_merge("merge_pre_commit_command_success",&repo,@@ -932,7 +932,7 @@ fn test_merge_pre_commit_command_failure(mut repo: TestRepo) {let feature_wt = repo.add_worktree("feature");fs::write(feature_wt.join("feature.txt"), "feature content").unwrap();- // Merge with --force - pre-commit command should fail and block merge+ // Merge with --yes - pre-commit command should fail and block mergesnapshot_merge("merge_pre_commit_command_failure",&repo,@@ -960,7 +960,7 @@ fn test_merge_pre_squash_command_success(mut repo: TestRepo) {// Create a feature worktree and make commitslet feature_wt = repo.add_feature();- // Merge with --force (squashing is now the default)+ // Merge with --yes (squashing is now the default)snapshot_merge("merge_pre_squash_command_success",&repo,@@ -982,7 +982,7 @@ fn test_merge_pre_squash_command_failure(mut repo: TestRepo) {repo.add_main_worktree();let feature_wt = repo.add_feature();- // Merge with --force (squashing is default) - pre-commit command should fail and block merge+ // Merge with --yes (squashing is default) - pre-commit command should fail and block mergesnapshot_merge("merge_pre_squash_command_failure",&repo,@@ -1266,7 +1266,7 @@ command = "{}");fs::write(repo.test_config_path(), worktrunk_config).unwrap();- // Merge with --force to skip approval prompts for commands+ // Merge with --yes to skip approval prompts for commands// This test explicitly sets PATH (which will be captured in snapshot) because it needs// to find mock commands in .bin directory. We use a clean, minimal PATH to avoid leaking// user-specific paths like ~/.cargo/bin into the snapshot.@@ -1359,7 +1359,7 @@ fi.output().unwrap();- // Set PATH to include mock commands and run switch --create with --force+ // Set PATH to include mock commands and run switch --create with --yeslet path_with_bin = format!("{}:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",bin_dir.display()@@ -1613,7 +1613,7 @@ command = "{}");fs::write(repo.test_config_path(), worktrunk_config).unwrap();- // Set PATH and merge with --force+ // Set PATH and merge with --yeslet path_with_bin = format!("{}:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",bin_dir.display()diff --git a/tests/integration_tests/post_start_commands.rs b/tests/integration_tests/post_start_commands.rsindex 8d9b6c095..9161c3b09 100644--- a/tests/integration_tests/post_start_commands.rs+++ b/tests/integration_tests/post_start_commands.rs@@ -224,7 +224,7 @@ approved-commands = ["echo 'Default: {{ default_branch }}' > default.txt"]"#,);- // Create a feature branch worktree (--force skips approval prompt)+ // Create a feature branch worktree (--yes skips approval prompt)snapshot_switch("post_create_default_branch_template",&repo,@@ -267,7 +267,7 @@ worktree_name = "echo 'Worktree Name: {{ worktree_name }}' >> git_vars.txt"repo.commit("Add config with git template variables");- // Create a feature branch worktree (--force skips approval prompt)+ // Create a feature branch worktree (--yes skips approval prompt)snapshot_switch("post_create_git_variables_template",&repo,diff --git a/tests/integration_tests/shell_wrapper.rs b/tests/integration_tests/shell_wrapper.rsindex 475919c61..7b636a32b 100644--- a/tests/integration_tests/shell_wrapper.rs+++ b/tests/integration_tests/shell_wrapper.rs@@ -854,7 +854,7 @@ mod tests {fn test_wrapper_switch_with_execute(#[case] shell: &str, repo: TestRepo) {skip_if_shell_unavailable!(shell);- // Use --force to skip approval prompt in tests+ // Use --yes to skip approval prompt in testslet output = exec_through_wrapper(shell,&repo,@@ -894,7 +894,7 @@ mod tests {fn test_wrapper_execute_exit_code_propagation(#[case] shell: &str, repo: TestRepo) {skip_if_shell_unavailable!(shell);- // Use --force to skip approval prompt in tests+ // Use --yes to skip approval prompt in tests// wt should succeed (creates worktree), but the execute command should fail with exit 42let output = exec_through_wrapper(shell,@@ -1223,7 +1223,7 @@ approved-commands = ["echo 'test command executed'"]#[rstest]fn test_switch_with_execute_through_wrapper(repo: TestRepo) {- // Use --force to skip approval prompt in tests+ // Use --yes to skip approval prompt in testslet output = exec_through_wrapper("bash",&repo,@@ -1447,7 +1447,7 @@ approved-commands = ["echo 'fish background task'"]// Use actual newlines in the command stringlet multiline_cmd = "echo 'line 1'; echo 'line 2'; echo 'line 3'";- // Use --force to skip approval prompt in tests+ // Use --yes to skip approval prompt in testslet output = exec_through_wrapper("fish",&repo,diff --git a/tests/integration_tests/switch.rs b/tests/integration_tests/switch.rsindex e0b120d8f..fc349c970 100644--- a/tests/integration_tests/switch.rs+++ b/tests/integration_tests/switch.rs@@ -353,7 +353,7 @@ fn test_switch_no_config_commands_with_existing_worktree(mut repo: TestRepo) {}#[rstest]-fn test_switch_no_config_commands_with_force(repo: TestRepo) {+fn test_switch_no_config_commands_with_yes(repo: TestRepo) {use std::fs;// Create project config with a command@@ -367,12 +367,12 @@ fn test_switch_no_config_commands_with_force(repo: TestRepo) {repo.commit("Add config");- // With --no-verify, even --force shouldn't execute config commands+ // With --no-verify, even --yes shouldn't execute config commands// (HOME is automatically set to repo.home_path() by clean_cli_env)snapshot_switch(- "switch_no_hooks_with_force",+ "switch_no_hooks_with_yes",&repo,- &["--create", "force-no-hooks", "--yes", "--no-verify"],+ &["--create", "yes-no-hooks", "--yes", "--no-verify"],);}// Branch inference and special branch testsdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__force_bypasses_tty_check.snap b/tests/snapshots/integration__integration_tests__approval_ui__yes_bypasses_tty_check.snapsimilarity index 86%rename from tests/snapshots/integration__integration_tests__approval_ui__force_bypasses_tty_check.snaprename to tests/snapshots/integration__integration_tests__approval_ui__yes_bypasses_tty_check.snapindex 59ca718e5..15046b1ee 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__force_bypasses_tty_check.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__yes_bypasses_tty_check.snap@@ -5,7 +5,7 @@ info:args:- switch- "--create"- - test-force-tty+ - test-yes-tty- "--yes"env:APPDATA: "[TEST_CONFIG_HOME]"@@ -35,5 +35,5 @@ exit_code: 0[36m◎[39m [36mRunning project post-create:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'test command'[0m[2m[0mtest command-[32m✓[39m [32mCreated new worktree for [1mtest-force-tty[22m from [1mmain[22m @ [1m_REPO_.test-force-tty[22m[39m+[32m✓[39m [32mCreated new worktree for [1mtest-yes-tty[22m from [1mmain[22m @ [1m_REPO_.test-yes-tty[22m[39m[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_first_run.snap b/tests/snapshots/integration__integration_tests__approval_ui__yes_does_not_save_approvals_first_run.snapsimilarity index 87%rename from tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_first_run.snaprename to tests/snapshots/integration__integration_tests__approval_ui__yes_does_not_save_approvals_first_run.snapindex cf8fbb42c..0486e945c 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_first_run.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__yes_does_not_save_approvals_first_run.snap@@ -5,7 +5,7 @@ info:args:- switch- "--create"- - test-force+ - test-yes- "--yes"env:APPDATA: "[TEST_CONFIG_HOME]"@@ -34,5 +34,5 @@ exit_code: 0----- stderr -----[36m◎[39m [36mRunning project post-create:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'test command'[0m[2m [0m[2m[36m>[0m[2m output.txt-[0m[32m✓[39m [32mCreated new worktree for [1mtest-force[22m from [1mmain[22m @ [1m_REPO_.test-force[22m[39m+[0m[32m✓[39m [32mCreated new worktree for [1mtest-yes[22m from [1mmain[22m @ [1m_REPO_.test-yes[22m[39m[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snap b/tests/snapshots/integration__integration_tests__approval_ui__yes_does_not_save_approvals_second_run.snapsimilarity index 100%rename from tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snaprename to tests/snapshots/integration__integration_tests__approval_ui__yes_does_not_save_approvals_second_run.snapdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_force.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_yes.snapsimilarity index 85%rename from tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_force.snaprename to tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_yes.snapindex f55e42321..0c01f5bcd 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_force.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_yes.snap@@ -5,7 +5,7 @@ info:args:- switch- "--create"- - force-no-hooks+ - yes-no-hooks- "--yes"- "--no-verify"env:@@ -33,5 +33,5 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated new worktree for [1mforce-no-hooks[22m from [1mmain[22m @ [1m_REPO_.force-no-hooks[22m[39m+[32m✓[39m [32mCreated new worktree for [1myes-no-hooks[22m from [1mmain[22m @ [1m_REPO_.yes-no-hooks[22m[39m[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m