Skip to content

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

feat: Enhance filter functionality, improve worktree messages, and restore state indicators

Maximilian Roosb36af3f25b30
diff --git a/src/commands/list/render.rs b/src/commands/list/render.rs
index 5c272b6f9..7e2af8137 100644
--- a/src/commands/list/render.rs
+++ b/src/commands/list/render.rs
@@ -205,6 +205,15 @@ pub fn format_all_states(item: &ListItem) -> String {
// Worktree-specific states
if let Some(info) = item.worktree_info() {
+ // State priority: "matches main" takes precedence over "no commits"
+ // since it's more specific (working tree identical to main)
+ if !info.is_primary && info.working_tree_diff_with_main == (0, 0) {
+ states.push("(matches main)".to_string());
+ } else if !info.is_primary && item.counts().ahead == 0 && info.working_tree_diff == (0, 0) {
+ // Only show "no commits" if working tree doesn't match main
+ states.push("(no commits)".to_string());
+ }
+
if let Some(state) = info.worktree_state.as_ref() {
states.push(format!("[{}]", state));
}
@@ -247,16 +256,38 @@ fn optional_reason_state(label: &str, reason: Option<&str>) -> Option<String> {
})
}
-/// Push a header at an absolute column position
-/// Check if a branch is potentially removable (nothing ahead, no uncommitted changes)
+/// Check if a branch/worktree is potentially removable
+///
+/// Dims rows for worktrees/branches that likely don't contain unique work
+/// beyond what's already in the main branch. This helps focus attention on
+/// worktrees that contain work.
+///
+/// Dims when (using OR logic):
+/// - No commits AND clean working tree (ahead == 0 AND working_tree_diff == (0, 0)):
+/// The worktree has no commits ahead and no uncommitted changes
+/// - Working tree matches main (working_tree_diff_with_main == (0, 0)):
+/// The working tree contents are identical to main, regardless of commit history
+///
+/// Either condition alone is sufficient to dim, as both indicate "no unique work here".
fn is_potentially_removable(item: &ListItem) -> bool {
+ if item.is_primary() {
+ return false;
+ }
+
let counts = item.counts();
- let wt_diff = item
- .worktree_info()
- .map(|info| info.working_tree_diff)
- .unwrap_or((0, 0));
- !item.is_primary() && counts.ahead == 0 && wt_diff == (0, 0)
+ if let Some(info) = item.worktree_info() {
+ // Condition 1: No commits ahead AND no uncommitted changes
+ let no_commits_and_clean = counts.ahead == 0 && info.working_tree_diff == (0, 0);
+
+ // Condition 2: Working tree matches main (regardless of commit history)
+ let matches_main = info.working_tree_diff_with_main == (0, 0);
+
+ no_commits_and_clean || matches_main
+ } else {
+ // For branches without worktrees, just check if no commits ahead
+ counts.ahead == 0
+ }
}
/// Render a list item (worktree or branch) as a formatted line
@@ -362,7 +393,11 @@ pub fn format_list_item_line(
let states = format_all_states(item);
if !states.is_empty() {
let states_text = format!("{:width$}", states, width = column.width);
- line.push_raw(states_text);
+ if let Some(style) = text_style {
+ line.push_styled(states_text, style);
+ } else {
+ line.push_raw(states_text);
+ }
} else {
push_blank(&mut line, column.width);
}
diff --git a/src/main.rs b/src/main.rs
index 83857cc49..8290e9dd1 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -24,7 +24,7 @@ use output::{execute_user_command, handle_remove_output, handle_switch_output};
pub enum OutputFormat {
/// Human-readable table format
Table,
- /// JSON format with colored unicode display fields
+ /// Machine-readable JSON with display fields (includes styled unicode for rendering)
Json,
}
@@ -143,26 +143,31 @@ enum Commands {
action: DevCommand,
},
- /// List all worktrees
+ /// List worktrees and optionally branches
+ #[command(after_help = "\
+STATE COLUMN:
+ (matches main): Working tree identical to main
+ (no commits): No commits ahead, clean working tree
+ (conflicts): Merge conflicts with main
+ [MERGING]/[REBASING]: Git operations in progress
+ (bare)/(locked)/(prunable): Worktree properties
+
+Rows are dimmed when no unique work (either no commits and clean working tree, or matches main).")]
List {
/// Output format
#[arg(long, value_enum, default_value = "table")]
format: OutputFormat,
- /// Also display branches that don't have worktrees
+ /// Include branches without worktrees
#[arg(long)]
branches: bool,
- /// Show all information (CI status, conflict detection, branch diff)
- ///
- /// Shows additional columns:
- /// - CI status: colored indicator (green=passed, blue=running, red=failed, yellow=conflicts, gray=no-ci)
- /// - Conflicts: ⚠️ indicator for branches with merge conflicts against main
- /// - Main ±: line diff totals (+added -deleted) in commits vs main
+ /// Show CI status, conflict detection, and complete diff statistics
///
- /// Requires gh (GitHub) or glab (GitLab) CLI for CI status.
- /// WARNING: Slow! Makes network requests and runs git merge-tree for conflict detection.
- #[arg(long)]
+ /// Adds columns: CI (pipeline status), Main ± (line diffs).
+ /// Enables conflict detection (shows "(conflicts)" in State column).
+ /// Requires network requests and git merge-tree operations.
+ #[arg(long, verbatim_doc_comment)]
full: bool,
},
diff --git a/tests/snapshots/integration__integration_tests__init__init_fish.snap b/tests/snapshots/integration__integration_tests__init__init_fish.snap
index 3ae2424bc..23ca1ae24 100644
--- a/tests/snapshots/integration__integration_tests__init__init_fish.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_fish.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpsB1EpK/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpitEqRx/test-config.toml
---
success: true
exit_code: 0
@@ -212,7 +212,7 @@ complete -c wt -n "__fish_wt_needs_command" -s V -l version -d 'Print version'
complete -c wt -n "__fish_wt_needs_command" -f -a "init" -d 'Generate shell integration code'
complete -c wt -n "__fish_wt_needs_command" -f -a "config" -d 'Manage configuration'
complete -c wt -n "__fish_wt_needs_command" -f -a "dev" -d 'Development and testing utilities'
-complete -c wt -n "__fish_wt_needs_command" -f -a "list" -d 'List all worktrees'
+complete -c wt -n "__fish_wt_needs_command" -f -a "list" -d 'List worktrees and optionally branches'
complete -c wt -n "__fish_wt_needs_command" -f -a "switch" -d 'Switch to a worktree'
complete -c wt -n "__fish_wt_needs_command" -f -a "remove" -d 'Finish current worktree, returning to primary if current'
complete -c wt -n "__fish_wt_needs_command" -f -a "merge" -d 'Merge worktree into target branch'
@@ -268,9 +268,9 @@ complete -c wt -n "__fish_wt_using_subcommand dev; and __fish_seen_subcommand_fr
complete -c wt -n "__fish_wt_using_subcommand dev; and __fish_seen_subcommand_from rebase" -s v -l verbose -d 'Enable verbose output (show git commands and debug info)'
complete -c wt -n "__fish_wt_using_subcommand dev; and __fish_seen_subcommand_from rebase" -s h -l help -d 'Print help'
complete -c wt -n "__fish_wt_using_subcommand list" -l format -d 'Output format' -r -f -a "table\t'Human-readable table format'
-json\t'JSON format with colored unicode display fields'"
-complete -c wt -n "__fish_wt_using_subcommand list" -l branches -d 'Also display branches that don\'t have worktrees'
-complete -c wt -n "__fish_wt_using_subcommand list" -l full -d 'Show all information (CI status, conflict detection, branch diff)'
+json\t'Machine-readable JSON with display fields (includes styled unicode for rendering)'"
+complete -c wt -n "__fish_wt_using_subcommand list" -l branches -d 'Include branches without worktrees'
+complete -c wt -n "__fish_wt_using_subcommand list" -l full -d 'Show CI status, conflict detection, and complete diff statistics'
complete -c wt -n "__fish_wt_using_subcommand list" -s v -l verbose -d 'Enable verbose output (show git commands and debug info)'
complete -c wt -n "__fish_wt_using_subcommand list" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c wt -n "__fish_wt_using_subcommand switch" -s b -l base -d 'Base branch to create from (only with --create)' -r
diff --git a/tests/snapshots/integration__integration_tests__init__init_zsh.snap b/tests/snapshots/integration__integration_tests__init__init_zsh.snap
index 09e7acc3e..1b802f2fd 100644
--- a/tests/snapshots/integration__integration_tests__init__init_zsh.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_zsh.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpZD3Pf7/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpxgY3i2/test-config.toml
---
success: true
exit_code: 0
@@ -300,9 +300,9 @@ esac
(list)
_arguments "${_arguments_options[@]}" : \
'--format=[Output format]:FORMAT:((table\:"Human-readable table format"
-json\:"JSON format with colored unicode display fields"))' \
-'--branches[Also display branches that don'\''t have worktrees]' \
-'--full[Show all information (CI status, conflict detection, branch diff)]' \
+json\:"Machine-readable JSON with display fields (includes styled unicode for rendering)"))' \
+'--branches[Include branches without worktrees]' \
+'--full[Show CI status, conflict detection, and complete diff statistics]' \
'-v[Enable verbose output (show git commands and debug info)]' \
'--verbose[Enable verbose output (show git commands and debug info)]' \
'-h[Print help (see more with '\''--help'\'')]' \
@@ -381,7 +381,7 @@ _wt_commands() {
'init:Generate shell integration code' \
'config:Manage configuration' \
'dev:Development and testing utilities' \
-'list:List all worktrees' \
+'list:List worktrees and optionally branches' \
'switch:Switch to a worktree' \
'remove:Finish current worktree, returning to primary if current' \
'merge:Merge worktree into target branch' \
diff --git a/tests/snapshots/integration__integration_tests__list__locked_no_reason.snap b/tests/snapshots/integration__integration_tests__list__locked_no_reason.snap
index 66711c05e..3285414ef 100644
--- a/tests/snapshots/integration__integration_tests__list__locked_no_reason.snap
+++ b/tests/snapshots/integration__integration_tests__list__locked_no_reason.snap
@@ -15,14 +15,14 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpTH2RWN/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpN2MM4G/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo  b834638e 10 months ago Initial commit
-locked-no-reason (locked) ./locked-no-reason b834638e 10 months ago Initial commit
+Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
+main  ./test-repo  b834638e 10 months ago Initial commit
+locked-no-reason (matches main) (locked) ./locked-no-reason b834638e 10 months ago Initial commit
Showing 2 worktrees
diff --git a/tests/snapshots/integration__integration_tests__list__locked_worktree.snap b/tests/snapshots/integration__integration_tests__list__locked_worktree.snap
index 3fbc05a06..e99a026a6 100644
--- a/tests/snapshots/integration__integration_tests__list__locked_worktree.snap
+++ b/tests/snapshots/integration__integration_tests__list__locked_worktree.snap
@@ -15,14 +15,14 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpfwWO3y/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpbMyoNo/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo  b834638e 10 months ago Initial commit
-locked-feature (locked: Testing lock functionality) ./locked-feature b834638e 10 months ago Initial commit
+Branch Working ± Main ↕ State Path Commit Age Message
+main  ./test-repo  b834638e 10 months ago Initial commit
+locked-feature (matches main) (locked: Testing lock functionality) ./locked-feature b834638e 10 months ago Initial commit
Showing 2 worktrees
diff --git a/tests/snapshots/integration__integration_tests__list__long_commit_message.snap b/tests/snapshots/integration__integration_tests__list__long_commit_message.snap
index 4efc86fd5..687c947c0 100644
--- a/tests/snapshots/integration__integration_tests__list__long_commit_message.snap
+++ b/tests/snapshots/integration__integration_tests__list__long_commit_message.snap
@@ -15,14 +15,14 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpkYt6zM/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpH391bB/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo 1310bfb9 10 months ago Short message
-feature-a ↓1 ./feature-a f078644e 10 months ago This is a very long commit message that should test how the...
+Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
+main  ./test-repo 1310bfb9 10 months ago Short message
+feature-a ↓1 (no commits) ./feature-a f078644e 10 months ago This is a very long commit message that should test...
Showing 2 worktrees, 1 behind
diff --git a/tests/snapshots/integration__integration_tests__list__many_worktrees_varied.snap b/tests/snapshots/integration__integration_tests__list__many_worktrees_varied.snap
index 853587af9..81c73b8fb 100644
--- a/tests/snapshots/integration__integration_tests__list__many_worktrees_varied.snap
+++ b/tests/snapshots/integration__integration_tests__list__many_worktrees_varied.snap
@@ -15,17 +15,17 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp8Mr4rb/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpCFNrJl/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo  b834638e 10 months ago Initial commit
-medium-name  ./medium-name  b834638e 10 months ago Initial commit
-short  ./short  b834638e 10 months ago Initial commit
-very-long-branch-name-here ./very-long-branch-name-here b834638e 10 months ago Initial commit
-with-changes  ./with-changes  b834638e 10 months ago Initial commit
+Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
+main  ./test-repo  b834638e 10 months ago Initial commit
+medium-name  (matches main) ./medium-name  b834638e 10 months ago Initial commit
+short  (matches main) ./short  b834638e 10 months ago Initial commit
+very-long-branch-name-here (matches main) ./very-long-branch-name-here b834638e 10 months ago Initial commit
+with-changes  (matches main) ./with-changes  b834638e 10 months ago Initial commit
Showing 5 worktrees
diff --git a/tests/snapshots/integration__integration_tests__list__multiple_worktrees.snap b/tests/snapshots/integration__integration_tests__list__multiple_worktrees.snap
index 02b520bb1..77a990eae 100644
--- a/tests/snapshots/integration__integration_tests__list__multiple_worktrees.snap
+++ b/tests/snapshots/integration__integration_tests__list__multiple_worktrees.snap
@@ -15,15 +15,15 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp691xwN/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpp9Qt9M/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo b834638e 10 months ago Initial commit
-feature-a ./feature-a b834638e 10 months ago Initial commit
-feature-b ./feature-b b834638e 10 months ago Initial commit
+Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
+main  ./test-repo b834638e 10 months ago Initial commit
+feature-a (matches main) ./feature-a b834638e 10 months ago Initial commit
+feature-b (matches main) ./feature-b b834638e 10 months ago Initial commit
Showing 3 worktrees
diff --git a/tests/snapshots/integration__integration_tests__list__unicode_commit_message.snap b/tests/snapshots/integration__integration_tests__list__unicode_commit_message.snap
index 0d8ff7646..2e540ec6c 100644
--- a/tests/snapshots/integration__integration_tests__list__unicode_commit_message.snap
+++ b/tests/snapshots/integration__integration_tests__list__unicode_commit_message.snap
@@ -15,14 +15,14 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpVJujXU/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp8Ik4NN/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo  e4614cb7 10 months ago Fix bug with café ☕ handling
-feature-test ↓1 ./feature-test 0c53695b 10 months ago Add support for 日本語 and émoji 🎉
+Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
+main  ./test-repo  e4614cb7 10 months ago Fix bug with café ☕ handling
+feature-test ↓1 (no commits) ./feature-test 0c53695b 10 months ago Add support for 日本語 and émoji 🎉
Showing 2 worktrees, 1 behind
diff --git a/tests/snapshots/integration__integration_tests__list__with_branches_flag.snap b/tests/snapshots/integration__integration_tests__list__with_branches_flag.snap
index de0167cb8..a4265d492 100644
--- a/tests/snapshots/integration__integration_tests__list__with_branches_flag.snap
+++ b/tests/snapshots/integration__integration_tests__list__with_branches_flag.snap
@@ -16,17 +16,17 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpOPYVub/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpVxZcGT/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo  b834638e 10 months ago Initial commit
-feature-with-worktree  ./feature-with-worktree b834638e 10 months ago Initial commit
-another-branch  b834638e 10 months ago Initial commit
-feature-without-worktree b834638e 10 months ago Initial commit
-fix-bug  b834638e 10 months ago Initial commit
+Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
+main  ./test-repo  b834638e 10 months ago Initial commit
+feature-with-worktree  (matches main) ./feature-with-worktree b834638e 10 months ago Initial commit
+another-branch  b834638e 10 months ago Initial commit
+feature-without-worktree b834638e 10 months ago Initial commit
+fix-bug  b834638e 10 months ago Initial commit
Showing 2 worktrees, 3 branches
diff --git a/tests/snapshots/integration__integration_tests__list__with_branches_flag_none_available.snap b/tests/snapshots/integration__integration_tests__list__with_branches_flag_none_available.snap
index 8c60f7b97..19393921f 100644
--- a/tests/snapshots/integration__integration_tests__list__with_branches_flag_none_available.snap
+++ b/tests/snapshots/integration__integration_tests__list__with_branches_flag_none_available.snap
@@ -16,15 +16,15 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpeOSNsp/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpm3kV5K/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo b834638e 10 months ago Initial commit
-feature-a ./feature-a b834638e 10 months ago Initial commit
-feature-b ./feature-b b834638e 10 months ago Initial commit
+Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
+main  ./test-repo b834638e 10 months ago Initial commit
+feature-a (matches main) ./feature-a b834638e 10 months ago Initial commit
+feature-b (matches main) ./feature-b b834638e 10 months ago Initial commit
Showing 3 worktrees
diff --git a/tests/snapshots/integration__integration_tests__security__commit_message_with_directive_not_executed.snap b/tests/snapshots/integration__integration_tests__security__commit_message_with_directive_not_executed.snap
index 4fd8e8f6a..9205b07cc 100644
--- a/tests/snapshots/integration__integration_tests__security__commit_message_with_directive_not_executed.snap
+++ b/tests/snapshots/integration__integration_tests__security__commit_message_with_directive_not_executed.snap
@@ -15,14 +15,14 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpiVNhgL/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpJqCsvu/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo [SHA] 10 months ago Fix bug __WORKTRUNK_EXEC__echo PWNED > /tmp/hacked4
-feature ./feature  [SHA] 10 months ago Fix bug __WORKTRUNK_EXEC__echo PWNED > /tmp/hacked4
+Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
+main  ./test-repo [SHA] 10 months ago Fix bug __WORKTRUNK_EXEC__echo PWNED > /tmp/hacked4
+feature (matches main) ./feature  [SHA] 10 months ago Fix bug __WORKTRUNK_EXEC__echo PWNED > /tmp/hacked4
Showing 2 worktrees
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_empty_diffs.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_empty_diffs.snap
index eb750656d..a4d426008 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_empty_diffs.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_empty_diffs.snap
@@ -15,16 +15,16 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpyUX3G8/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpxTmTQ9/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo  b834638e 10 months ago Initial commit
-also-no-changes ./also-no-changes b834638e 10 months ago Initial commit
-no-changes  ./no-changes  b834638e 10 months ago Initial commit
-with-changes +1 -1 ./with-changes b834638e 10 months ago Initial commit
+Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
+main  ./test-repo  b834638e 10 months ago Initial commit
+also-no-changes (matches main) ./also-no-changes b834638e 10 months ago Initial commit
+no-changes  (matches main) ./no-changes  b834638e 10 months ago Initial commit
+with-changes +1 -1 ./with-changes b834638e 10 months ago Initial commit
Showing 4 worktrees, 1 with changes
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_extreme_diffs.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_extreme_diffs.snap
index 2b9fb6881..a2daae586 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_extreme_diffs.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_extreme_diffs.snap
@@ -15,15 +15,15 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpGggAqs/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpVm3njK/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo b834638e 10 months ago Initial commit
-huge  ./huge  b834638e 10 months ago Initial commit
-tiny +1 -1 ./tiny b834638e 10 months ago Initial commit
+Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
+main  ./test-repo b834638e 10 months ago Initial commit
+huge  (matches main) ./huge  b834638e 10 months ago Initial commit
+tiny +1 -1 ./tiny b834638e 10 months ago Initial commit
Showing 3 worktrees, 1 with changes
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_varying_diffs.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_varying_diffs.snap
index 67551958c..bf94cfb72 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_varying_diffs.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_varying_diffs.snap
@@ -15,16 +15,16 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpH2NTRJ/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp6JpNNt/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo  b834638e 10 months ago Initial commit
-feature-large  ./feature-large  b834638e 10 months ago Initial commit
-feature-medium ./feature-medium b834638e 10 months ago Initial commit
-feature-small  ./feature-small  b834638e 10 months ago Initial commit
+Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
+main  ./test-repo  b834638e 10 months ago Initial commit
+feature-large  (matches main) ./feature-large  b834638e 10 months ago Initial commit
+feature-medium (matches main) ./feature-medium b834638e 10 months ago Initial commit
+feature-small  (matches main) ./feature-small  b834638e 10 months ago Initial commit
Showing 4 worktrees
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__long_branch_names.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__long_branch_names.snap
index dba2a687a..382da7931 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__long_branch_names.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__long_branch_names.snap
@@ -15,16 +15,16 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpjxlend/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp9SdodL/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo  b834638e 10 months ago Initial commit
-another-extremely-long-name-here ./another-extremely-long-name-here b834638e 10 months ago Initial commit
-short  ./short  b834638e 10 months ago Initial commit
-very-long-feature-branch-name  ./very-long-feature-branch-name  b834638e 10 months ago Initial commit
+Branch Working ± Main ↕ State Path Commit Age Message
+main  ./test-repo  b834638e 10 months ago Initial commit
+another-extremely-long-name-here (matches main) ./another-extremely-long-name-here b834638e 10 months ago Initial commit
+short  (matches main) ./short  b834638e 10 months ago Initial commit
+very-long-feature-branch-name  (matches main) ./very-long-feature-branch-name  b834638e 10 months ago Initial commit
Showing 4 worktrees
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__mixed_length_branch_names.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__mixed_length_branch_names.snap
index 8af48286c..47c42ddb0 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__mixed_length_branch_names.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__mixed_length_branch_names.snap
@@ -15,16 +15,16 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpZYqcod/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpwxJfVH/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo  b834638e 10 months ago Initial commit
-long  ./extremely-long-branch-name-that-might-cause-layout-issues b834638e 10 months ago Initial commit
-medium ./medium-length-name  b834638e 10 months ago Initial commit
-x  ./x  b834638e 10 months ago Initial commit
+Branch Working ± Main ↕ State Path Commit Age Message
+main  ./test-repo  b834638e 10 months ago Initial commit
+long  (matches main) ./extremely-long-branch-name-that-might-cause-layout-issues b834638e 10 months ago Initial commit
+medium (matches main) ./medium-length-name  b834638e 10 months ago Initial commit
+x  (matches main) ./x  b834638e 10 months ago Initial commit
Showing 4 worktrees
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__short_branch_names.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__short_branch_names.snap
index dbd42d29e..baafc581a 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__short_branch_names.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__short_branch_names.snap
@@ -15,16 +15,16 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpSEYNgZ/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpVFT2Yw/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo b834638e 10 months ago Initial commit
-a  ./a  b834638e 10 months ago Initial commit
-bb  ./bb  b834638e 10 months ago Initial commit
-ccc  ./ccc  b834638e 10 months ago Initial commit
+Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
+main  ./test-repo b834638e 10 months ago Initial commit
+a  (matches main) ./a  b834638e 10 months ago Initial commit
+bb  (matches main) ./bb  b834638e 10 months ago Initial commit
+ccc  (matches main) ./ccc  b834638e 10 months ago Initial commit
Showing 4 worktrees
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_120.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_120.snap
index 314e11212..99556f96c 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_120.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_120.snap
@@ -15,15 +15,15 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpYDU9Lq/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpEuCxwf/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Commit Age Message
-main  ./test-repo a7bc47ca 10 months ago Initial commit with a reasonably long message
-feature-a ./feature-a a7bc47ca 10 months ago Initial commit with a reasonably long message
-feature-b ./feature-b a7bc47ca 10 months ago Initial commit with a reasonably long message
+Branch Main ↕ State Path Commit Age Message
+main  ./test-repo a7bc47ca 10 months ago Initial commit with a reasonably long message
+feature-a (matches main) ./feature-a a7bc47ca 10 months ago Initial commit with a reasonably long message
+feature-b (matches main) ./feature-b a7bc47ca 10 months ago Initial commit with a reasonably long message
Showing 3 worktrees
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_150.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_150.snap
index 817d6a34f..9a8540b83 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_150.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_150.snap
@@ -15,15 +15,15 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpTJojTf/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpZM5HzU/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo a7bc47ca 10 months ago Initial commit with a reasonably long message
-feature-a ./feature-a a7bc47ca 10 months ago Initial commit with a reasonably long message
-feature-b ./feature-b a7bc47ca 10 months ago Initial commit with a reasonably long message
+Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
+main  ./test-repo a7bc47ca 10 months ago Initial commit with a reasonably long message
+feature-a (matches main) ./feature-a a7bc47ca 10 months ago Initial commit with a reasonably long message
+feature-b (matches main) ./feature-b a7bc47ca 10 months ago Initial commit with a reasonably long message
Showing 3 worktrees
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_80.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_80.snap
index 596fbe8c3..7c149af6e 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_80.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_80.snap
@@ -15,15 +15,15 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpRX8cEf/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpT4OjpO/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Path Commit Age Message
-main  ./test-repo a7bc47ca 10 months ago Initial commit with a...
-feature-a ./feature-a a7bc47ca 10 months ago Initial commit with a...
-feature-b ./feature-b a7bc47ca 10 months ago Initial commit with a...
+Branch Working ± State Path Commit Age
+main  ./test-repo a7bc47ca 10 months ago
+feature-a (matches main) ./feature-a a7bc47ca 10 months ago
+feature-b (matches main) ./feature-b a7bc47ca 10 months ago
Showing 3 worktrees
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__unicode_branch_names.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__unicode_branch_names.snap
index 0869f6bdb..ee06200d4 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__unicode_branch_names.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__unicode_branch_names.snap
@@ -15,16 +15,16 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpbKhZjn/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpSaL67x/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
-main  ./test-repo b834638e 10 months ago Initial commit
-cafe  ./café  b834638e 10 months ago Initial commit
-naive  ./naïve  b834638e 10 months ago Initial commit
-resume ./résumé  b834638e 10 months ago Initial commit
+Branch Working ± Main ↕ State Path Remote ↕ Commit Age Message
+main  ./test-repo b834638e 10 months ago Initial commit
+cafe  (matches main) ./café  b834638e 10 months ago Initial commit
+naive  (matches main) ./naïve  b834638e 10 months ago Initial commit
+resume (matches main) ./résumé  b834638e 10 months ago Initial commit
Showing 4 worktrees