Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
feat: Specify "worktree" in remove messages
Maximilian Roosf359de0e24d9
diff --git a/CLAUDE.md b/CLAUDE.mdindex d46fa632d..7f49b8b84 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -108,31 +108,31 @@ Use consistent punctuation and structure for related messages:**Semicolon for qualifiers:** Separate the action from a qualifier/reason:```rust// Action; qualifier (flag)-"Removing feature in background; retaining branch (--no-delete-branch)"+"Removing feature worktree in background; retaining branch (--no-delete-branch)""Commands approved; not saved (--force)"```**Ampersand for conjunctions:** Use `&` for combined actions:```rust// Action & additional action-"Removing feature & branch in background"+"Removing feature worktree & branch in background""Commands approved & saved to config"```**Explicit flag acknowledgment:** Show flags in parentheses when they change behavior:```rust// ✅ GOOD - shows the flag explicitly-"Removing feature in background; retaining branch (--no-delete-branch)"+"Removing feature worktree in background; retaining branch (--no-delete-branch)"// ❌ BAD - doesn't acknowledge user's explicit choice-"Removing feature in background; retaining branch"+"Removing feature worktree in background; retaining branch"```**Parallel structure:** Related messages should follow the same pattern:```rust// ✅ GOOD - parallel structure distinguishes user choice from system decision-"Removing feature & branch in background" // Merged (will delete)-"Removing feature in background; retaining unmerged branch" // Unmerged (system keeps)-"Removing feature in background; retaining branch (--no-delete-branch)" // User flag (user keeps)+"Removing feature worktree & branch in background" // Merged (will delete)+"Removing feature worktree in background; retaining unmerged branch" // Unmerged (system keeps)+"Removing feature worktree in background; retaining branch (--no-delete-branch)" // User flag (user keeps)```**Compute decisions once:** For background operations, check conditions upfront, show the message, then pass the decision explicitly rather than re-checking in background scripts:diff --git a/src/output/handlers.rs b/src/output/handlers.rsindex e20ffeb28..6a6fd6b59 100644--- a/src/output/handlers.rs+++ b/src/output/handlers.rs@@ -222,21 +222,21 @@ pub fn handle_remove_output(// Show progress message based on what we'll dolet action = if *no_delete_branch {format!(- "{CYAN}Removing {CYAN_BOLD}{branch_name}{CYAN_BOLD:#}{CYAN} in background; retaining branch (--no-delete-branch){CYAN:#}"+ "{CYAN}Removing {CYAN_BOLD}{branch_name}{CYAN_BOLD:#}{CYAN} worktree in background; retaining branch (--no-delete-branch){CYAN:#}")} else if should_delete_branch {if *force_delete {format!(- "{CYAN}Removing {CYAN_BOLD}{branch_name}{CYAN_BOLD:#}{CYAN} & branch in background (--force-delete){CYAN:#}"+ "{CYAN}Removing {CYAN_BOLD}{branch_name}{CYAN_BOLD:#}{CYAN} worktree & branch in background (--force-delete){CYAN:#}")} else {format!(- "{CYAN}Removing {CYAN_BOLD}{branch_name}{CYAN_BOLD:#}{CYAN} & branch in background{CYAN:#}"+ "{CYAN}Removing {CYAN_BOLD}{branch_name}{CYAN_BOLD:#}{CYAN} worktree & branch in background{CYAN:#}")}} else {format!(- "{CYAN}Removing {CYAN_BOLD}{branch_name}{CYAN_BOLD:#}{CYAN} in background; retaining unmerged branch{CYAN:#}"+ "{CYAN}Removing {CYAN_BOLD}{branch_name}{CYAN_BOLD:#}{CYAN} worktree in background; retaining unmerged branch{CYAN:#}")};super::progress(action)?;diff --git a/tests/integration_tests/directives.rs b/tests/integration_tests/directives.rsindex bb8892a56..1e59adcdb 100644--- a/tests/integration_tests/directives.rs+++ b/tests/integration_tests/directives.rs@@ -89,7 +89,7 @@ fn test_remove_internal_directive() {----- stdout -----__WORKTRUNK_CD__[PATH]----- stderr ------ 🔄 [36mRemoving [1m[36mmain[0m[36m & branch in background[0m+ 🔄 [36mRemoving [1m[36mmain[0m[36m worktree & branch in background[0m");});}@@ -112,7 +112,7 @@ fn test_remove_without_internal() {success: trueexit_code: 0----- stdout ------ 🔄 [36mRemoving [1m[36mmain[0m[36m & branch in background[0m+ 🔄 [36mRemoving [1m[36mmain[0m[36m worktree & branch in background[0m----- stderr -----");diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__remove.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__remove.snapindex 0ab13a9ff..d4b8a67f1 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__remove.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__remove.snap@@ -2,4 +2,4 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----🔄 [36mRemoving [1m[36mto-remove[0m[36m & branch in background[0m+🔄 [36mRemoving [1m[36mto-remove[0m[36m worktree & branch in background[0mdiff --git a/tests/snapshots/integration__integration_tests__remove__remove_already_on_default.snap b/tests/snapshots/integration__integration_tests__remove__remove_already_on_default.snapindex e7ee1458f..758a330a4 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_already_on_default.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_already_on_default.snap@@ -9,8 +9,11 @@ info:COLUMNS: "150"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_COUNT: "1"GIT_CONFIG_GLOBAL: /dev/null+ GIT_CONFIG_KEY_0: advice.mergeConflictGIT_CONFIG_SYSTEM: /dev/null+ GIT_CONFIG_VALUE_0: "false"GIT_EDITOR: ""LANG: CLC_ALL: C@@ -20,6 +23,6 @@ info:success: trueexit_code: 0----- stdout ------🔄 [36mRemoving [1m[36mmain[0m[36m & branch in background[0m+🔄 [36mRemoving [1m[36mmain[0m[36m worktree & branch in background[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__remove__remove_branch_not_fully_merged.snap b/tests/snapshots/integration__integration_tests__remove__remove_branch_not_fully_merged.snapindex d1ffa1a82..e47f684f9 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_branch_not_fully_merged.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_branch_not_fully_merged.snap@@ -10,8 +10,11 @@ info:COLUMNS: "150"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_COUNT: "1"GIT_CONFIG_GLOBAL: /dev/null+ GIT_CONFIG_KEY_0: advice.mergeConflictGIT_CONFIG_SYSTEM: /dev/null+ GIT_CONFIG_VALUE_0: "false"GIT_EDITOR: ""LANG: CLC_ALL: C@@ -21,6 +24,6 @@ info:success: trueexit_code: 0----- stdout ------🔄 [36mRemoving [1m[36mfeature-unmerged[0m[36m in background; retaining unmerged branch[0m+🔄 [36mRemoving [1m[36mfeature-unmerged[0m[36m worktree in background; retaining unmerged branch[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__remove__remove_by_name_from_main.snap b/tests/snapshots/integration__integration_tests__remove__remove_by_name_from_main.snapindex 5992ec613..af159e6ce 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_by_name_from_main.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_by_name_from_main.snap@@ -10,8 +10,11 @@ info:COLUMNS: "150"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_COUNT: "1"GIT_CONFIG_GLOBAL: /dev/null+ GIT_CONFIG_KEY_0: advice.mergeConflictGIT_CONFIG_SYSTEM: /dev/null+ GIT_CONFIG_VALUE_0: "false"GIT_EDITOR: ""LANG: CLC_ALL: C@@ -21,6 +24,6 @@ info:success: trueexit_code: 0----- stdout ------🔄 [36mRemoving [1m[36mfeature-a[0m[36m & branch in background[0m+🔄 [36mRemoving [1m[36mfeature-a[0m[36m worktree & branch in background[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__remove__remove_by_name_from_other_worktree.snap b/tests/snapshots/integration__integration_tests__remove__remove_by_name_from_other_worktree.snapindex 9739ddba2..5875546da 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_by_name_from_other_worktree.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_by_name_from_other_worktree.snap@@ -10,8 +10,11 @@ info:COLUMNS: "150"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_COUNT: "1"GIT_CONFIG_GLOBAL: /dev/null+ GIT_CONFIG_KEY_0: advice.mergeConflictGIT_CONFIG_SYSTEM: /dev/null+ GIT_CONFIG_VALUE_0: "false"GIT_EDITOR: ""LANG: CLC_ALL: C@@ -21,6 +24,6 @@ info:success: trueexit_code: 0----- stdout ------🔄 [36mRemoving [1m[36mfeature-b[0m[36m & branch in background[0m+🔄 [36mRemoving [1m[36mfeature-b[0m[36m worktree & branch in background[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__remove__remove_current_by_name.snap b/tests/snapshots/integration__integration_tests__remove__remove_current_by_name.snapindex cfb608adb..cd62ecda9 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_current_by_name.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_current_by_name.snap@@ -10,8 +10,11 @@ info:COLUMNS: "150"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_COUNT: "1"GIT_CONFIG_GLOBAL: /dev/null+ GIT_CONFIG_KEY_0: advice.mergeConflictGIT_CONFIG_SYSTEM: /dev/null+ GIT_CONFIG_VALUE_0: "false"GIT_EDITOR: ""LANG: CLC_ALL: C@@ -21,6 +24,6 @@ info:success: trueexit_code: 0----- stdout ------🔄 [36mRemoving [1m[36mfeature-current[0m[36m & branch in background[0m+🔄 [36mRemoving [1m[36mfeature-current[0m[36m worktree & branch in background[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snap b/tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snapindex 3cd0f5aa8..cde2208df 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snap@@ -9,8 +9,11 @@ info:COLUMNS: "150"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_COUNT: "1"GIT_CONFIG_GLOBAL: /dev/null+ GIT_CONFIG_KEY_0: advice.mergeConflictGIT_CONFIG_SYSTEM: /dev/null+ GIT_CONFIG_VALUE_0: "false"GIT_EDITOR: ""LANG: CLC_ALL: C@@ -20,6 +23,6 @@ info:success: trueexit_code: 0----- stdout ------🔄 [36mRemoving [1m[36mfeature-wt[0m[36m & branch in background[0m+🔄 [36mRemoving [1m[36mfeature-wt[0m[36m worktree & branch in background[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap b/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snapindex 27e099da8..1b1507da2 100644Binary files a/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap and b/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap differdiff --git a/tests/snapshots/integration__integration_tests__remove__remove_multiple_including_current.snap b/tests/snapshots/integration__integration_tests__remove__remove_multiple_including_current.snapindex 3a0ae6c4f..e99915185 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_multiple_including_current.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_multiple_including_current.snap@@ -12,8 +12,11 @@ info:COLUMNS: "150"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_COUNT: "1"GIT_CONFIG_GLOBAL: /dev/null+ GIT_CONFIG_KEY_0: advice.mergeConflictGIT_CONFIG_SYSTEM: /dev/null+ GIT_CONFIG_VALUE_0: "false"GIT_EDITOR: ""LANG: CLC_ALL: C@@ -23,8 +26,8 @@ info:success: trueexit_code: 0----- stdout ------🔄 [36mRemoving [1m[36mfeature-b[0m[36m & branch in background[0m-🔄 [36mRemoving [1m[36mfeature-c[0m[36m & branch in background[0m-🔄 [36mRemoving [1m[36mfeature-a[0m[36m & branch in background[0m+🔄 [36mRemoving [1m[36mfeature-b[0m[36m worktree & branch in background[0m+🔄 [36mRemoving [1m[36mfeature-c[0m[36m worktree & branch in background[0m+🔄 [36mRemoving [1m[36mfeature-a[0m[36m worktree & branch in background[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__remove__remove_multiple_worktrees.snap b/tests/snapshots/integration__integration_tests__remove__remove_multiple_worktrees.snapindex 9e355df57..9bdd5fbad 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_multiple_worktrees.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_multiple_worktrees.snap@@ -12,8 +12,11 @@ info:COLUMNS: "150"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_COUNT: "1"GIT_CONFIG_GLOBAL: /dev/null+ GIT_CONFIG_KEY_0: advice.mergeConflictGIT_CONFIG_SYSTEM: /dev/null+ GIT_CONFIG_VALUE_0: "false"GIT_EDITOR: ""LANG: CLC_ALL: C@@ -23,8 +26,8 @@ info:success: trueexit_code: 0----- stdout ------🔄 [36mRemoving [1m[36mfeature-a[0m[36m & branch in background[0m-🔄 [36mRemoving [1m[36mfeature-b[0m[36m & branch in background[0m-🔄 [36mRemoving [1m[36mfeature-c[0m[36m & branch in background[0m+🔄 [36mRemoving [1m[36mfeature-a[0m[36m worktree & branch in background[0m+🔄 [36mRemoving [1m[36mfeature-b[0m[36m worktree & branch in background[0m+🔄 [36mRemoving [1m[36mfeature-c[0m[36m worktree & branch in background[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__remove__remove_no_delete_branch.snap b/tests/snapshots/integration__integration_tests__remove__remove_no_delete_branch.snapindex 464b48f9d..ad5b1023a 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_no_delete_branch.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_no_delete_branch.snap@@ -11,8 +11,11 @@ info:COLUMNS: "150"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_COUNT: "1"GIT_CONFIG_GLOBAL: /dev/null+ GIT_CONFIG_KEY_0: advice.mergeConflictGIT_CONFIG_SYSTEM: /dev/null+ GIT_CONFIG_VALUE_0: "false"GIT_EDITOR: ""LANG: CLC_ALL: C@@ -22,6 +25,6 @@ info:success: trueexit_code: 0----- stdout ------🔄 [36mRemoving [1m[36mfeature-keep[0m[36m in background; retaining branch (--no-delete-branch)[0m+🔄 [36mRemoving [1m[36mfeature-keep[0m[36m worktree in background; retaining branch (--no-delete-branch)[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__remove__remove_switch_to_default.snap b/tests/snapshots/integration__integration_tests__remove__remove_switch_to_default.snapindex ef6664833..2231cd2a4 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_switch_to_default.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_switch_to_default.snap@@ -9,8 +9,11 @@ info:COLUMNS: "150"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_COUNT: "1"GIT_CONFIG_GLOBAL: /dev/null+ GIT_CONFIG_KEY_0: advice.mergeConflictGIT_CONFIG_SYSTEM: /dev/null+ GIT_CONFIG_VALUE_0: "false"GIT_EDITOR: ""LANG: CLC_ALL: C@@ -20,6 +23,6 @@ info:success: trueexit_code: 0----- stdout ------🔄 [36mRemoving [1m[36mfeature[0m[36m & branch in background[0m+🔄 [36mRemoving [1m[36mfeature[0m[36m worktree & branch in background[0m----- stderr -----