Skip to content

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

Clarify remove command help text

Maximilian Roos143ec2a4977d
diff --git a/docs/content/remove.md b/docs/content/remove.md
index 11f9569c7..16d3261a3 100644
--- a/docs/content/remove.md
+++ b/docs/content/remove.md
@@ -8,7 +8,7 @@ group = "Commands"
<!-- ⚠️ AUTO-GENERATED from `wt remove --help-page` — edit cli.rs to update -->
-Removes worktrees and their branches. Without arguments, removes the current worktree and returns to the main worktree.
+Removes worktrees and their branches (if merged), returning to the main worktree. Defaults to removing the current worktree.
## Examples
@@ -39,7 +39,7 @@ wt remove -D experimental
## Branch cleanup
-Branches delete automatically when merging them would add nothing. This works with squash-merge and rebase workflows where commit history differs but file changes match.
+By default, branches are deleted when merging them would add nothing. This works with squash-merge and rebase workflows where commit history differs but file changes match.
Worktrunk checks five conditions (in order of cost):
@@ -71,7 +71,7 @@ Removal runs in the background by default (returns immediately). Logs are writte
## Command reference
{% terminal() %}
-wt remove - Remove worktree and branch
+wt remove - Remove worktree and branch (if merged)
Usage: <b><span class=c>wt remove</span></b> <span class=c>[OPTIONS]</span> <span class=c>[BRANCHES]...</span>
diff --git a/src/cli.rs b/src/cli.rs
index f8f8cd9f1..88fb98266 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -2390,9 +2390,9 @@ To change which branch a worktree is on, use `git switch` inside that worktree.
verify: bool,
},
- /// Remove worktree and branch
+ /// Remove worktree and branch (if merged)
#[command(
- after_long_help = r#"Removes worktrees and their branches. Without arguments, removes the current worktree and returns to the main worktree.
+ after_long_help = r#"Removes worktrees and their branches (if merged), returning to the main worktree. Defaults to removing the current worktree.
## Examples
@@ -2423,7 +2423,7 @@ wt remove -D experimental
## Branch cleanup
-Branches delete automatically when merging them would add nothing. This works with squash-merge and rebase workflows where commit history differs but file changes match.
+By default, branches are deleted when merging them would add nothing. This works with squash-merge and rebase workflows where commit history differs but file changes match.
Worktrunk checks five conditions (in order of cost):
diff --git a/tests/snapshots/integration__integration_tests__help__help_md_root.snap b/tests/snapshots/integration__integration_tests__help__help_md_root.snap
index b15bf14fa..86db0d108 100644
--- a/tests/snapshots/integration__integration_tests__help__help_md_root.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_md_root.snap
@@ -11,6 +11,7 @@ info:
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
---
success: true
exit_code: 0
@@ -26,7 +27,7 @@ Commands:
select Interactive worktree selector
list List worktrees and optionally branches
switch Switch to a worktree
- remove Remove worktree and branch
+ remove Remove worktree and branch (if merged)
merge Merge worktree into target branch
Options:
diff --git a/tests/snapshots/integration__integration_tests__help__help_no_args.snap b/tests/snapshots/integration__integration_tests__help__help_no_args.snap
index 48f5491bd..a099a5ead 100644
--- a/tests/snapshots/integration__integration_tests__help__help_no_args.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_no_args.snap
@@ -7,8 +7,10 @@ info:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_EDITOR: ""
+ RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
---
success: true
exit_code: 0
@@ -26,7 +28,7 @@ Usage: wt [OPTIONS] [COMMAND]
select Interactive worktree selector
list List worktrees and optionally branches
switch Switch to a worktree
- remove Remove worktree and branch
+ remove Remove worktree and branch (if merged)
merge Merge worktree into target branch
Options:
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
index c1c06ea8f..26ce79637 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
@@ -12,13 +12,14 @@ info:
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
---
success: true
exit_code: 0
----- stdout -----
----- stderr -----
-wt remove - Remove worktree and branch
+wt remove - Remove worktree and branch (if merged)
Usage: wt remove [OPTIONS] [BRANCHES]...
@@ -60,7 +61,7 @@ Usage: wt remove [OPTIONS] [BRANCHES]...
-v, --verbose
Show commands and debug info
-Removes worktrees and their branches. Without arguments, removes the current worktree and returns to the main worktree.
+Removes worktrees and their branches (if merged), returning to the main worktree. Defaults to removing the current worktree.
Examples
@@ -83,8 +84,8 @@ Force-delete an unmerged branch:
Branch cleanup
-Branches delete automatically when merging them would add nothing. This works with squash-merge and rebase workflows where commit history differs but
-file changes match.
+By default, branches are deleted when merging them would add nothing. This works with squash-merge and rebase workflows where commit history differs
+but file changes match.
Worktrunk checks five conditions (in order of cost):
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_short.snap b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
index 5a4002023..ca10b2765 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
@@ -12,13 +12,14 @@ info:
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
---
success: true
exit_code: 0
----- stdout -----
----- stderr -----
-wt remove - Remove worktree and branch
+wt remove - Remove worktree and branch (if merged)
Usage: wt remove [OPTIONS] [BRANCHES]...
diff --git a/tests/snapshots/integration__integration_tests__help__help_root_long.snap b/tests/snapshots/integration__integration_tests__help__help_root_long.snap
index 019a158e7..cc853e12e 100644
--- a/tests/snapshots/integration__integration_tests__help__help_root_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_root_long.snap
@@ -11,6 +11,7 @@ info:
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
---
success: true
exit_code: 0
@@ -28,7 +29,7 @@ Usage: wt [OPTIONS] [COMMAND]
select Interactive worktree selector
list List worktrees and optionally branches
switch Switch to a worktree
- remove Remove worktree and branch
+ remove Remove worktree and branch (if merged)
merge Merge worktree into target branch
Options:
diff --git a/tests/snapshots/integration__integration_tests__help__help_root_short.snap b/tests/snapshots/integration__integration_tests__help__help_root_short.snap
index 6728dff01..9134845b5 100644
--- a/tests/snapshots/integration__integration_tests__help__help_root_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_root_short.snap
@@ -8,8 +8,10 @@ info:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_EDITOR: ""
+ RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
---
success: true
exit_code: 0
@@ -27,7 +29,7 @@ Usage: wt [OPTIONS] [COMMAND]
select Interactive worktree selector
list List worktrees and optionally branches
switch Switch to a worktree
- remove Remove worktree and branch
+ remove Remove worktree and branch (if merged)
merge Merge worktree into target branch
Options: