Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Refactor switch success message for clarity
Maximilian Roosda278eb7fb3a
diff --git a/src/output/directive.rs b/src/output/directive.rsindex 3b5e3a630..e1acf3d99 100644--- a/src/output/directive.rs+++ b/src/output/directive.rs@@ -86,7 +86,7 @@ impl DirectiveOutput {/// Format a switch success message for directive mode////// In directive mode, the shell wrapper will actually change directories,- /// so we can say "changed directory to {path}"+ /// so we indicate the path with ": {path}"pub fn format_switch_success(&self,branch: &str,diff --git a/src/output/global.rs b/src/output/global.rsindex 30d324991..cc461a6e1 100644--- a/src/output/global.rs+++ b/src/output/global.rs@@ -140,7 +140,7 @@ pub fn terminate_output() -> io::Result<()> {/// Format a switch success message (mode-specific)////// In interactive mode: "at {path}" (can't actually change directory)-/// In directive mode: "changed directory to {path}" (shell will change it)+/// In directive mode: ": {path}" (shell will change it)pub fn format_switch_success(branch: &str,path: &Path,diff --git a/src/output/mod.rs b/src/output/mod.rsindex 6ca4ab171..baa159ac5 100644--- a/src/output/mod.rs+++ b/src/output/mod.rs@@ -78,7 +78,7 @@ use std::path::Path;////// The message format differs between interactive and directive modes:/// - Interactive: "Created new worktree for {branch} from {base} at {path}"-/// - Directive: "Created new worktree for {branch} from {base}, changed directory to {path}"+/// - Directive: "Created new worktree for {branch} from {base}: {path}"pub(crate) fn format_switch_success_message(branch: &str,path: &Path,@@ -97,11 +97,7 @@ pub(crate) fn format_switch_success_message(let base_suffix = base_branch.map(|b| format!(" from {green_bold}{b}{green_bold:#}{GREEN}")).unwrap_or_default();- let location = if use_past_tense {- ", changed directory to"- } else {- " at"- };+ let location = if use_past_tense { ":" } else { " at" };format!("{SUCCESS_EMOJI} {GREEN}{action} {green_bold}{branch}{green_bold:#}{GREEN}{base_suffix}{location} {green_bold}{}{green_bold:#}{GREEN:#}",diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__bash_shell_integration_hint_suppressed.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__bash_shell_integration_hint_suppressed.snapindex 16d705970..3d12ce5ad 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__bash_shell_integration_hint_suppressed.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__bash_shell_integration_hint_suppressed.snap@@ -2,4 +2,4 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----β [32mCreated new worktree for [1m[32mbash-test[0m[32m from [1m[32mmain[0m[32m, changed directory to [1m[32m[TMPDIR]/test-repo.bash-test[0m[0m+β [32mCreated new worktree for [1m[32mbash-test[0m[32m from [1m[32mmain[0m[32m: [1m[32m[TMPDIR]/test-repo.bash-test[0m[0mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_multiline_command_execution.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_multiline_command_execution.snapindex 87f07ac7a..1bd3de242 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_multiline_command_execution.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_multiline_command_execution.snap@@ -2,7 +2,7 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----β [32mCreated new worktree for [1m[32mfish-multiline[0m[32m from [1m[32mmain[0m[32m, changed directory to [1m[32m[TMPDIR]/test-repo.fish-multiline[0m[0m+β [32mCreated new worktree for [1m[32mfish-multiline[0m[32m from [1m[32mmain[0m[32m: [1m[32m[TMPDIR]/test-repo.fish-multiline[0m[0mπ [36mExecuting (--execute):[0m[40m [0m [1m[34mecho[0m [32m'line 1'[0m; [1m[34mecho[0m [32m'line 2'[0m; [1m[34mecho[0m [32m'line 3'[0m[0mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_handles_empty_chunks.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_handles_empty_chunks.snapindex dfce837ea..57540710b 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_handles_empty_chunks.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_handles_empty_chunks.snap@@ -2,4 +2,4 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----β [32mCreated new worktree for [1m[32mfish-minimal[0m[32m from [1m[32mmain[0m[32m, changed directory to [1m[32m[TMPDIR]/test-repo.fish-minimal[0m[0m+β [32mCreated new worktree for [1m[32mfish-minimal[0m[32m from [1m[32mmain[0m[32m: [1m[32m[TMPDIR]/test-repo.fish-minimal[0m[0mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_preserves_progress_messages.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_preserves_progress_messages.snapindex e253c3456..407d40927 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_preserves_progress_messages.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_preserves_progress_messages.snap@@ -2,6 +2,6 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----β [32mCreated new worktree for [1m[32mfish-bg[0m[32m from [1m[32mmain[0m[32m, changed directory to [1m[32m[TMPDIR]/test-repo.fish-bg[0m[0m+β [32mCreated new worktree for [1m[32mfish-bg[0m[32m from [1m[32mmain[0m[32m: [1m[32m[TMPDIR]/test-repo.fish-bg[0m[0mπ [36mRunning post-start:[0m[40m [0m [1m[34mecho[0m [32m'fish background task'[0m[0mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_create.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_create.snapindex 2493b3fd9..548bc145f 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_create.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_create.snap@@ -2,4 +2,4 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----β [32mCreated new worktree for [1m[32mfeature[0m[32m from [1m[32mmain[0m[32m, changed directory to [1m[32m[TMPDIR]/test-repo.feature[0m[0m+β [32mCreated new worktree for [1m[32mfeature[0m[32m from [1m[32mmain[0m[32m: [1m[32m[TMPDIR]/test-repo.feature[0m[0mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_execute.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_execute.snapindex 434f431d8..2b43a584f 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_execute.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_execute.snap@@ -2,7 +2,7 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----β [32mCreated new worktree for [1m[32mtest-exec[0m[32m from [1m[32mmain[0m[32m, changed directory to [1m[32m[TMPDIR]/test-repo.test-exec[0m[0m+β [32mCreated new worktree for [1m[32mtest-exec[0m[32m from [1m[32mmain[0m[32m: [1m[32m[TMPDIR]/test-repo.test-exec[0m[0mπ [36mExecuting (--execute):[0m[40m [0m [1m[34mecho[0m executed[0mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_execute_through_wrapper.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_execute_through_wrapper.snapindex 434f431d8..2b43a584f 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_execute_through_wrapper.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_execute_through_wrapper.snap@@ -2,7 +2,7 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----β [32mCreated new worktree for [1m[32mtest-exec[0m[32m from [1m[32mmain[0m[32m, changed directory to [1m[32m[TMPDIR]/test-repo.test-exec[0m[0m+β [32mCreated new worktree for [1m[32mtest-exec[0m[32m from [1m[32mmain[0m[32m: [1m[32m[TMPDIR]/test-repo.test-exec[0m[0mπ [36mExecuting (--execute):[0m[40m [0m [1m[34mecho[0m executed[0mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snapindex 96327de94..4e00306f0 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap@@ -12,7 +12,7 @@ Building project...[40m [0m [1m[34mecho[0m [32m'Building project...'[0m[0m-β [32mCreated new worktree for [1m[32mfeature-hooks[0m[32m from [1m[32mmain[0m[32m, changed directory to [1m[32m[TMPDIR]/test-repo.feature-hooks[0m[0m+β [32mCreated new worktree for [1m[32mfeature-hooks[0m[32m from [1m[32mmain[0m[32m: [1m[32m[TMPDIR]/test-repo.feature-hooks[0m[0mπ [36mRunning post-start: [1mserver[0m[0m[40m [0m [1m[34mecho[0m [32m'Starting dev server on port 3000'[0m[0mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_post_start_command_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_post_start_command_no_directive_leak.snapindex 9306f4729..8f4592d12 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_post_start_command_no_directive_leak.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_post_start_command_no_directive_leak.snap@@ -2,6 +2,6 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----β [32mCreated new worktree for [1m[32mfeature-with-hooks[0m[32m from [1m[32mmain[0m[32m, changed directory to [1m[32m[TMPDIR]/test-repo.feature-with-hooks[0m[0m+β [32mCreated new worktree for [1m[32mfeature-with-hooks[0m[32m from [1m[32mmain[0m[32m: [1m[32m[TMPDIR]/test-repo.feature-with-hooks[0m[0mπ [36mRunning post-start:[0m[40m [0m [1m[34mecho[0m [32m'test command executed'[0m[0mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__wrapper_preserves_progress_messages.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__wrapper_preserves_progress_messages.snapindex 4089aad15..7451e64ef 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__wrapper_preserves_progress_messages.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__wrapper_preserves_progress_messages.snap@@ -2,6 +2,6 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----β [32mCreated new worktree for [1m[32mfeature-bg[0m[32m from [1m[32mmain[0m[32m, changed directory to [1m[32m[TMPDIR]/test-repo.feature-bg[0m[0m+β [32mCreated new worktree for [1m[32mfeature-bg[0m[32m from [1m[32mmain[0m[32m: [1m[32m[TMPDIR]/test-repo.feature-bg[0m[0mπ [36mRunning post-start:[0m[40m [0m [1m[34mecho[0m [32m'background task'[0m[0mdiff --git a/tests/snapshots/integration__integration_tests__e2e_shell__bash_e2e_switch_linebreaks.snap b/tests/snapshots/integration__integration_tests__e2e_shell__bash_e2e_switch_linebreaks.snapindex a61fa7542..b9f416587 100644--- a/tests/snapshots/integration__integration_tests__e2e_shell__bash_e2e_switch_linebreaks.snap+++ b/tests/snapshots/integration__integration_tests__e2e_shell__bash_e2e_switch_linebreaks.snap@@ -2,5 +2,5 @@source: tests/integration_tests/e2e_shell.rsexpression: output----β [32mCreated new worktree for [1m[32mtest-branch[0m[32m from [1m[32mmain[0m[32m, changed directory to [1m[32m[REPO].test-branch[0m[0m+β [32mCreated new worktree for [1m[32mtest-branch[0m[32m from [1m[32mmain[0m[32m: [1m[32m[REPO].test-branch[0m[0mMARKERdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_existing_internal.snap b/tests/snapshots/integration__integration_tests__switch__switch_existing_internal.snapindex 5e18f43e4..ce44c6279 100644Binary files a/tests/snapshots/integration__integration_tests__switch__switch_existing_internal.snap and b/tests/snapshots/integration__integration_tests__switch__switch_existing_internal.snap differdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_internal_mode.snap b/tests/snapshots/integration__integration_tests__switch__switch_internal_mode.snapindex 8057d17a7..b72c9f082 100644Binary files a/tests/snapshots/integration__integration_tests__switch__switch_internal_mode.snap and b/tests/snapshots/integration__integration_tests__switch__switch_internal_mode.snap differdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_internal_with_execute.snap b/tests/snapshots/integration__integration_tests__switch__switch_internal_with_execute.snapindex 4389ca9b5..6f852663a 100644Binary files a/tests/snapshots/integration__integration_tests__switch__switch_internal_with_execute.snap and b/tests/snapshots/integration__integration_tests__switch__switch_internal_with_execute.snap differ