Skip to content

feat: add --columns flag for list, sync, and prune commands#310

Merged
avihut merged 17 commits intomasterfrom
feat/list-columns
Mar 16, 2026
Merged

feat: add --columns flag for list, sync, and prune commands#310
avihut merged 17 commits intomasterfrom
feat/list-columns

Conversation

@avihut
Copy link
Owner

@avihut avihut commented Mar 16, 2026

Summary

  • Add --columns flag to git-worktree-list, git-worktree-sync, and git-worktree-prune that controls which columns are displayed and in what order
  • Replace mode: --columns branch,path,age — exact columns in exact order
  • Modifier mode: --columns=-annotation,-last-commit — add/remove from defaults using canonical ordering
  • Mixed prefixed/unprefixed values produce a clear error
  • Configurable via git config: daft.list.columns, daft.sync.columns, daft.prune.columns
  • JSON output filtered to match selected columns when --columns is specified
  • status column pinned on sync/prune (error if user tries to control it)
  • Shell completions for column names (plain, +, - prefixed) across bash, zsh, fish, and fig
  • Column headers styled with dim + underline

Test plan

  • mise run fmt:check passes
  • mise run clippy passes with zero warnings
  • mise run test:unit passes (662 tests)
  • YAML scenarios pass: columns-replace, columns-json, columns-modifier, columns-config, columns-errors
  • Sync/prune YAML scenarios pass: sync:columns, prune:columns
  • mise run man:verify confirms man pages are up to date
  • Manual smoke test: git worktree list --columns branch,path,age
  • Manual smoke test: git worktree list --columns=-annotation
  • Manual smoke test: git worktree list --json --columns branch,path
  • Manual smoke test: git worktree sync --columns status produces error

🤖 Generated with Claude Code

avihut and others added 17 commits March 16, 2026 08:41
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix column order to match TUI code (remote before changes), clarify
JSON output scope (list only), replace future size column examples with
existing columns, add duplicate/whitespace handling rules, note long
flag only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Align error message column order with registry (remote before changes),
replace +size config example with existing columns.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove unused clap::ValueEnum derive from ListColumn
- Add ResolvedColumns type to track replace vs modifier mode
- Thread columns_explicit through TuiState for responsive dropping
- Add YAML tests for sync/prune --columns (status error cases)
- Add shell completion task for column value suggestions
- Add SKILL.md update task
- Fix +size reference in help text

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The existing list.rs and TUI both display Changes before Remote.
Align spec and plan to match this order instead of swapping them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rune

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add value completion for --columns in bash, zsh, fish, and fig for
git-worktree-list, git-worktree-sync, and git-worktree-prune. Suggests
all column names (annotation, branch, path, base, changes, remote, age,
last-commit) as well as + and - prefixed variants.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move column validation to run() before the TTY check so errors
(like status column rejection) surface in both sequential and TUI
modes. Also fix YAML test field name and modifier mode --columns=
syntax.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bold made headers appear white. Dim + underline keeps the subdued
color while adding visual emphasis to distinguish headers from data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The test framework field is output_not_contains, not output_excludes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avihut avihut added this to the Public Launch milestone Mar 16, 2026
@avihut avihut added the feat New feature label Mar 16, 2026
@avihut avihut self-assigned this Mar 16, 2026
@avihut avihut merged commit 9b2dd62 into master Mar 16, 2026
8 checks passed
@avihut avihut deleted the feat/list-columns branch March 16, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant