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.mdindex 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.rsindex 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.rsindex 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 flagWouldMergeAdd {item_idx: usize,would_merge_add: bool,diff --git a/src/commands/list/collect_progressive_impl.rs b/src/commands/list/collect_progressive_impl.rsindex 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 mergediff --git a/src/commands/list/mod.rs b/src/commands/list/mod.rsindex 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 modediff --git a/src/commands/list/model.rs b/src/commands/list/model.rsindex 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 changesif 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.snapindex 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 showThe Status column has multiple subcolumns. Within each, only the first matching symbol is shown (listed in priority order):- Subcolumn Symbol Meaning- ──────────────── ────── ────────────────────────────────────────────────────- Working tree (1) [36m+[0m Staged files- Working tree (2) [36m![0m Modified files (unstaged)- Working tree (3) [36m?[0m Untracked files- Worktree [31m✘[0m Merge conflicts- [33m⤴[0m Rebase in progress- [33m⤵[0m Merge in progress- [2m/[0m Branch without worktree- [31m⚑[0m Path doesn't match template- [33m⊟[0m Prunable (directory missing)- [33m⊞[0m Locked worktree- Main [2m^[0m Is the main branch- [33m✗[0m Would conflict if merged to main- [2m_[0m Same commit as main- [2m⊂[0m Content integrated ([2m--full[0m detects additional cases)- [2m↕[0m Diverged from main- [2m↑[0m Ahead of main- [2m↓[0m Behind main- Remote [2m|[0m In sync with remote- [2m⇅[0m Diverged from remote- [2m⇡[0m Ahead of remote- [2m⇣[0m Behind remote+ Subcolumn Symbol Meaning+ ──────────────── ────── ────────────────────────────────+ Working tree (1) [36m+[0m Staged files+ Working tree (2) [36m![0m Modified files (unstaged)+ Working tree (3) [36m?[0m Untracked files+ Worktree [31m✘[0m Merge conflicts+ [33m⤴[0m Rebase in progress+ [33m⤵[0m Merge in progress+ [2m/[0m Branch without worktree+ [31m⚑[0m Path doesn't match template+ [33m⊟[0m Prunable (directory missing)+ [33m⊞[0m Locked worktree+ Main [2m^[0m Is the main branch+ [33m✗[0m Would conflict if merged to main+ [2m_[0m Same commit as main+ [2m⊂[0m Content integrated+ [2m↕[0m Diverged from main+ [2m↑[0m Ahead of main+ [2m↓[0m Behind main+ Remote [2m|[0m In sync with remote+ [2m⇅[0m Diverged from remote+ [2m⇡[0m Ahead of remote+ [2m⇣[0m Behind remoteRows are dimmed when the branch content is already in main ([2m_[0m same commit or [2m⊂[0m content integrated).