Skip to content

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

refactor(list): Simplify `--full` and remove `--ci` flag

Maximilian Roosd7268fcd09fb
diff --git a/src/commands/list/layout.rs b/src/commands/list/layout.rs
index fe7c430c7..2f5462b5c 100644
--- a/src/commands/list/layout.rs
+++ b/src/commands/list/layout.rs
@@ -249,7 +249,7 @@ pub fn calculate_column_widths(items: &[ListItem]) -> ColumnWidths {
}
/// Calculate responsive layout based on terminal width
-pub fn calculate_responsive_layout(items: &[ListItem]) -> LayoutConfig {
+pub fn calculate_responsive_layout(items: &[ListItem], show_full: bool) -> LayoutConfig {
let terminal_width = get_terminal_width();
let paths: Vec<&Path> = items
.iter()
@@ -335,14 +335,18 @@ pub fn calculate_responsive_layout(items: &[ListItem]) -> LayoutConfig {
}
// Branch diff column (work volume in those commits)
- let allocated_width = try_allocate(
- &mut remaining,
- ideal_widths.branch_diff.total,
- spacing,
- false,
- );
- if allocated_width > 0 {
- widths.branch_diff = ideal_widths.branch_diff;
+ // Hidden by default - considered too noisy for typical usage.
+ // May reconsider showing by default in future based on user feedback.
+ if show_full {
+ let allocated_width = try_allocate(
+ &mut remaining,
+ ideal_widths.branch_diff.total,
+ spacing,
+ false,
+ );
+ if allocated_width > 0 {
+ widths.branch_diff = ideal_widths.branch_diff;
+ }
}
// Conflicts column (merge conflicts indicator - critical for mergeability)
@@ -547,7 +551,7 @@ mod tests {
};
let items = vec![super::ListItem::Worktree(info)];
- let layout = calculate_responsive_layout(&items);
+ let layout = calculate_responsive_layout(&items, false);
let pos = &layout.positions;
let widths = &layout.widths;
@@ -630,7 +634,7 @@ mod tests {
};
let items = vec![super::ListItem::Worktree(info)];
- let layout = calculate_responsive_layout(&items);
+ let layout = calculate_responsive_layout(&items, false);
let pos = &layout.positions;
// Branch should be at 0
@@ -693,7 +697,7 @@ mod tests {
};
let items = vec![super::ListItem::Worktree(info)];
- let layout = calculate_responsive_layout(&items);
+ let layout = calculate_responsive_layout(&items, false);
let pos = &layout.positions;
let widths = &layout.widths;
diff --git a/src/commands/list/mod.rs b/src/commands/list/mod.rs
index 6c2c8b9d9..29b8161b5 100644
--- a/src/commands/list/mod.rs
+++ b/src/commands/list/mod.rs
@@ -73,14 +73,13 @@ fn enrich_with_display_fields(mut item: ListItem) -> ListItem {
pub fn handle_list(
format: crate::OutputFormat,
show_branches: bool,
- fetch_ci: bool,
- check_conflicts: bool,
+ show_full: bool,
) -> Result<(), GitError> {
let repo = Repository::current();
let Some(ListData {
items,
current_worktree_path,
- }) = gather_list_data(&repo, show_branches, fetch_ci, check_conflicts)?
+ }) = gather_list_data(&repo, show_branches, show_full, show_full)?
else {
return Ok(());
};
@@ -96,7 +95,7 @@ pub fn handle_list(
println!("{}", json);
}
crate::OutputFormat::Table => {
- let layout = calculate_responsive_layout(&items);
+ let layout = calculate_responsive_layout(&items, show_full);
format_header_line(&layout);
for item in &items {
format_list_item_line(item, &layout, current_worktree_path.as_ref());
diff --git a/src/main.rs b/src/main.rs
index 15dbf37dd..994430447 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -152,22 +152,15 @@ enum Commands {
#[arg(long)]
branches: bool,
- /// Fetch CI status from GitHub/GitLab PRs/MRs
+ /// Show all information (CI status, conflict detection, branch diff)
///
- /// Shows colored indicator for each branch: green (passed), blue (running),
- /// red (failed), yellow (conflicts), gray (no CI). Dimmed = stale (unpushed commits).
+ /// 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
///
- /// Requires gh (GitHub) or glab (GitLab) CLI installed and authenticated.
- /// WARNING: Slow! Adds ~0.5-2s per branch (makes network requests).
- #[arg(long)]
- ci: bool,
-
- /// Show all information (CI status + conflict detection)
- ///
- /// Enables both --ci and conflict detection. Shows ⚠️ indicator for branches
- /// that would have merge conflicts with main.
- ///
- /// WARNING: Slow! Runs git merge-tree for every branch to detect conflicts.
+ /// 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)]
full: bool,
},
@@ -440,13 +433,8 @@ fn main() {
Commands::List {
format,
branches,
- ci,
full,
- } => {
- let fetch_ci = ci || full;
- let check_conflicts = full;
- handle_list(format, branches, fetch_ci, check_conflicts)
- }
+ } => handle_list(format, branches, full),
Commands::Switch {
branch,
create,
diff --git a/tests/snapshots/integration__integration_tests__init__init_bash.snap b/tests/snapshots/integration__integration_tests__init__init_bash.snap
index a9d77cb62..5cc12202b 100644
--- a/tests/snapshots/integration__integration_tests__init__init_bash.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_bash.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpMWhULf/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpE95Qy5/test-config.toml
---
success: true
exit_code: 0
@@ -449,7 +449,7 @@ _wt() {
return 0
;;
wt__list)
- opts="-v -h --format --branches --ci --full --verbose --help"
+ opts="-v -h --format --branches --full --verbose --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
diff --git a/tests/snapshots/integration__integration_tests__init__init_fish.snap b/tests/snapshots/integration__integration_tests__init__init_fish.snap
index 9feed40b8..c2592f023 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/.tmpRI5DMl/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpSfk2JM/test-config.toml
---
success: true
exit_code: 0
@@ -270,8 +270,7 @@ complete -c wt -n "__fish_wt_using_subcommand dev; and __fish_seen_subcommand_fr
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 ci -d 'Fetch CI status from GitHub/GitLab PRs/MRs'
-complete -c wt -n "__fish_wt_using_subcommand list" -l full -d 'Show all information (CI status + conflict detection)'
+complete -c wt -n "__fish_wt_using_subcommand list" -l full -d 'Show all information (CI status, conflict detection, branch diff)'
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 0b3264fe7..7bc2fa85f 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/.tmpC5169N/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpCEH56P/test-config.toml
---
success: true
exit_code: 0
@@ -302,8 +302,7 @@ _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]' \
-'--ci[Fetch CI status from GitHub/GitLab PRs/MRs]' \
-'--full[Show all information (CI status + conflict detection)]' \
+'--full[Show all information (CI status, conflict detection, branch diff)]' \
'-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'\'')]' \