Skip to content

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.md
index 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.rs
index 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 do
let 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.rs
index 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 -----
- 🔄 Removing main & branch in background
+ 🔄 Removing main worktree & branch in background
");
});
}
@@ -112,7 +112,7 @@ fn test_remove_without_internal() {
success: true
exit_code: 0
----- stdout -----
- 🔄 Removing main & branch in background
+ 🔄 Removing main worktree & branch in background
----- 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.snap
index 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.rs
expression: output.normalized()
---
-🔄 Removing to-remove & branch in background
+🔄 Removing to-remove worktree & branch in background
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_already_on_default.snap b/tests/snapshots/integration__integration_tests__remove__remove_already_on_default.snap
index 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.mergeConflict
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_CONFIG_VALUE_0: "false"
GIT_EDITOR: ""
LANG: C
LC_ALL: C
@@ -20,6 +23,6 @@ info:
success: true
exit_code: 0
----- stdout -----
-🔄 Removing main & branch in background
+🔄 Removing main worktree & branch in background
----- 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.snap
index 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.mergeConflict
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_CONFIG_VALUE_0: "false"
GIT_EDITOR: ""
LANG: C
LC_ALL: C
@@ -21,6 +24,6 @@ info:
success: true
exit_code: 0
----- stdout -----
-🔄 Removing feature-unmerged in background; retaining unmerged branch
+🔄 Removing feature-unmerged worktree in background; retaining unmerged branch
----- 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.snap
index 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.mergeConflict
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_CONFIG_VALUE_0: "false"
GIT_EDITOR: ""
LANG: C
LC_ALL: C
@@ -21,6 +24,6 @@ info:
success: true
exit_code: 0
----- stdout -----
-🔄 Removing feature-a & branch in background
+🔄 Removing feature-a worktree & branch in background
----- 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.snap
index 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.mergeConflict
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_CONFIG_VALUE_0: "false"
GIT_EDITOR: ""
LANG: C
LC_ALL: C
@@ -21,6 +24,6 @@ info:
success: true
exit_code: 0
----- stdout -----
-🔄 Removing feature-b & branch in background
+🔄 Removing feature-b worktree & branch in background
----- 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.snap
index 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.mergeConflict
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_CONFIG_VALUE_0: "false"
GIT_EDITOR: ""
LANG: C
LC_ALL: C
@@ -21,6 +24,6 @@ info:
success: true
exit_code: 0
----- stdout -----
-🔄 Removing feature-current & branch in background
+🔄 Removing feature-current worktree & branch in background
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snap b/tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snap
index 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.mergeConflict
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_CONFIG_VALUE_0: "false"
GIT_EDITOR: ""
LANG: C
LC_ALL: C
@@ -20,6 +23,6 @@ info:
success: true
exit_code: 0
----- stdout -----
-🔄 Removing feature-wt & branch in background
+🔄 Removing feature-wt worktree & branch in background
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap b/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap
index 27e099da8..1b1507da2 100644
Binary files a/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap and b/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap differ
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_multiple_including_current.snap b/tests/snapshots/integration__integration_tests__remove__remove_multiple_including_current.snap
index 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.mergeConflict
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_CONFIG_VALUE_0: "false"
GIT_EDITOR: ""
LANG: C
LC_ALL: C
@@ -23,8 +26,8 @@ info:
success: true
exit_code: 0
----- stdout -----
-🔄 Removing feature-b & branch in background
-🔄 Removing feature-c & branch in background
-🔄 Removing feature-a & branch in background
+🔄 Removing feature-b worktree & branch in background
+🔄 Removing feature-c worktree & branch in background
+🔄 Removing feature-a worktree & branch in background
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_multiple_worktrees.snap b/tests/snapshots/integration__integration_tests__remove__remove_multiple_worktrees.snap
index 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.mergeConflict
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_CONFIG_VALUE_0: "false"
GIT_EDITOR: ""
LANG: C
LC_ALL: C
@@ -23,8 +26,8 @@ info:
success: true
exit_code: 0
----- stdout -----
-🔄 Removing feature-a & branch in background
-🔄 Removing feature-b & branch in background
-🔄 Removing feature-c & branch in background
+🔄 Removing feature-a worktree & branch in background
+🔄 Removing feature-b worktree & branch in background
+🔄 Removing feature-c worktree & branch in background
----- 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.snap
index 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.mergeConflict
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_CONFIG_VALUE_0: "false"
GIT_EDITOR: ""
LANG: C
LC_ALL: C
@@ -22,6 +25,6 @@ info:
success: true
exit_code: 0
----- stdout -----
-🔄 Removing feature-keep in background; retaining branch (--no-delete-branch)
+🔄 Removing feature-keep worktree in background; retaining branch (--no-delete-branch)
----- 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.snap
index 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.mergeConflict
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_CONFIG_VALUE_0: "false"
GIT_EDITOR: ""
LANG: C
LC_ALL: C
@@ -20,6 +23,6 @@ info:
success: true
exit_code: 0
----- stdout -----
-🔄 Removing feature & branch in background
+🔄 Removing feature worktree & branch in background
----- stderr -----