Skip to content

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

Remove `--full` flag requirement for content integration detection

Maximilian Roosf39c4428b0f0
diff --git a/docs/content/list.md b/docs/content/list.md
index f296e8089..c51657fec 100644
--- a/docs/content/list.md
+++ b/docs/content/list.md
@@ -120,7 +120,7 @@ The Status column has multiple subcolumns. Within each, only the first matching
| Main | `^` | Is the main branch |
| | `✗` | Would conflict if merged to main |
| | `_` | Same commit as main |
-| | `⊂` | [Content integrated](@/remove.md#branch-cleanup) (`--full` detects additional cases) |
+| | `⊂` | [Content integrated](@/remove.md#branch-cleanup) |
| | `↕` | Diverged from main |
| | `↑` | Ahead of main |
| | `↓` | Behind main |
diff --git a/src/cli.rs b/src/cli.rs
index 2e241896c..ed96d521f 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -1579,7 +1579,7 @@ The Status column has multiple subcolumns. Within each, only the first matching
| Main | `^` | Is the main branch |
| | `✗` | Would conflict if merged to main |
| | `_` | Same commit as main |
-| | `⊂` | [Content integrated](@/remove.md#branch-cleanup) (`--full` detects additional cases) |
+| | `⊂` | [Content integrated](@/remove.md#branch-cleanup) |
| | `↕` | Diverged from main |
| | `↑` | Ahead of main |
| | `↓` | Behind main |
diff --git a/src/commands/list/collect.rs b/src/commands/list/collect.rs
index 5a6ab33d2..7865aea7f 100644
--- a/src/commands/list/collect.rs
+++ b/src/commands/list/collect.rs
@@ -80,7 +80,6 @@ pub(super) enum TaskResult {
has_file_changes: bool,
},
/// Whether merging branch into main would add changes (merge simulation)
- /// Only computed with --full flag
WouldMergeAdd {
item_idx: usize,
would_merge_add: bool,
diff --git a/src/commands/list/collect_progressive_impl.rs b/src/commands/list/collect_progressive_impl.rs
index c9540f198..adbae072c 100644
--- a/src/commands/list/collect_progressive_impl.rs
+++ b/src/commands/list/collect_progressive_impl.rs
@@ -249,7 +249,7 @@ impl Task for HasFileChangesTask {
}
}
-/// Task 3b: Merge simulation (--full only)
+/// Task 3b: Merge simulation
///
/// Checks if merging the branch into main would add any changes by simulating
/// the merge with `git merge-tree --write-tree`. Returns false when the merge
diff --git a/src/commands/list/mod.rs b/src/commands/list/mod.rs
index 6f6e176ec..0b7b256e0 100644
--- a/src/commands/list/mod.rs
+++ b/src/commands/list/mod.rs
@@ -152,17 +152,16 @@ pub fn handle_list(
let repo = Repository::current();
// Build skip set based on flags
- // Without --full: skip expensive operations (BranchDiff, CiStatus, WouldMergeAdd)
+ // Without --full: skip expensive operations (BranchDiff, CiStatus)
+ // TODO: WouldMergeAdd (~500ms-2s per worktree) is currently enabled for ⊂ detection.
+ // If this causes performance issues, consider adding it back to skip_tasks or
+ // implementing a timeout for the merge simulation.
let skip_tasks: std::collections::HashSet<TaskKind> = if show_full {
std::collections::HashSet::new() // Compute everything
} else {
- [
- TaskKind::BranchDiff,
- TaskKind::CiStatus,
- TaskKind::WouldMergeAdd,
- ]
- .into_iter()
- .collect()
+ [TaskKind::BranchDiff, TaskKind::CiStatus]
+ .into_iter()
+ .collect()
};
// Progressive rendering only for table format with Progressive mode
diff --git a/src/commands/list/model.rs b/src/commands/list/model.rs
index 54937283a..15a11f87d 100644
--- a/src/commands/list/model.rs
+++ b/src/commands/list/model.rs
@@ -212,7 +212,7 @@ pub struct ListItem {
pub has_file_changes: Option<bool>,
/// Whether merging branch into main would add changes (merge simulation).
/// False when `git merge-tree --write-tree main branch` produces same tree as main.
- /// Only computed with `--full` flag. Catches squash-merged branches where main advanced.
+ /// Catches squash-merged branches where main advanced.
#[serde(skip)]
pub would_merge_add: Option<bool>,
/// Whether branch HEAD is an ancestor of main (or same commit).
@@ -320,8 +320,8 @@ impl ListItem {
/// Catches squash-merged branches where commits exist but add no files.
/// 3. **Tree matches main** - tree SHA equals main's tree SHA.
/// Catches rebased/squash-merged branches with identical content.
- /// 4. **Merge simulation** (`--full` only) - merging branch into main wouldn't
- /// change main's tree. Catches squash-merged branches where main has advanced.
+ /// 4. **Merge simulation** - merging branch into main wouldn't change main's
+ /// tree. Catches squash-merged branches where main has advanced.
/// 5. **Working tree matches main** (worktrees only) - uncommitted changes
/// don't diverge from main.
pub(crate) fn is_potentially_removable(&self) -> bool {
@@ -358,7 +358,7 @@ impl ListItem {
return true;
}
- // Check 4: Merge simulation (--full only)
+ // Check 4: Merge simulation
// Merging branch into main wouldn't add changes - content already integrated.
// This catches cases where main has advanced past the squash-merge point.
if self.would_merge_add == Some(false) && is_working_tree_clean() {
@@ -620,7 +620,7 @@ impl ListItem {
/// - `behind_main`: Number of commits branch is behind main (None = not computed)
/// - `committed_trees_match`: Whether committed tree SHAs match (HEAD^{tree} == main^{tree})
/// - `has_file_changes`: Whether three-dot diff has file changes (None = not computed)
-/// - `would_merge_add`: Whether merge simulation shows changes (None = not computed, `--full` only)
+/// - `would_merge_add`: Whether merge simulation shows changes (None = not computed)
/// - `working_tree_diff_with_main`: Diff between working tree and main. May be `None` (not
/// computed) or `Some(None)` (skipped). When unavailable, assumes no match.
#[allow(clippy::too_many_arguments)]
@@ -671,7 +671,7 @@ fn determine_integration_state(
return (false, Some(IntegrationReason::TreesMatch));
}
- // Priority 6: Merge simulation shows no changes (--full only)
+ // Priority 6: Merge simulation shows no changes
if would_merge_add == Some(false) && is_clean {
return (false, Some(IntegrationReason::MergeAddsNothing));
}
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_long.snap b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
index 6603fafc3..0c6e303f8 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
@@ -118,29 +118,29 @@ CI is only checked for branches that track a remote — local-only branches show
The Status column has multiple subcolumns. Within each, only the first matching symbol is shown (listed in priority order):
- Subcolumn Symbol Meaning
- ──────────────── ────── ────────────────────────────────────────────────────
- Working tree (1) + Staged files
- Working tree (2) ! Modified files (unstaged)
- Working tree (3) ? Untracked files
- Worktree ✘ Merge conflicts
- ⤴ Rebase in progress
- ⤵ Merge in progress
- / Branch without worktree
- ⚑ Path doesn't match template
- ⊟ Prunable (directory missing)
- ⊞ Locked worktree
- Main ^ Is the main branch
- ✗ Would conflict if merged to main
- _ Same commit as main
- ⊂ Content integrated (--full detects additional cases)
- ↕ Diverged from main
- ↑ Ahead of main
- ↓ Behind main
- Remote | In sync with remote
- ⇅ Diverged from remote
- ⇡ Ahead of remote
- ⇣ Behind remote
+ Subcolumn Symbol Meaning
+ ──────────────── ────── ────────────────────────────────
+ Working tree (1) + Staged files
+ Working tree (2) ! Modified files (unstaged)
+ Working tree (3) ? Untracked files
+ Worktree ✘ Merge conflicts
+ ⤴ Rebase in progress
+ ⤵ Merge in progress
+ / Branch without worktree
+ ⚑ Path doesn't match template
+ ⊟ Prunable (directory missing)
+ ⊞ Locked worktree
+ Main ^ Is the main branch
+ ✗ Would conflict if merged to main
+ _ Same commit as main
+ ⊂ Content integrated
+ ↕ Diverged from main
+ ↑ Ahead of main
+ ↓ Behind main
+ Remote | In sync with remote
+ ⇅ Diverged from remote
+ ⇡ Ahead of remote
+ ⇣ Behind remote
Rows are dimmed when the branch content is already in main (_ same commit or ⊂ content integrated).