feat: add optional size column with summary footer#315
Merged
Conversation
Add a new `size` column showing the disk size of each worktree folder in human-readable format (e.g. 42K, 1.3M, 2.5G). The column is not shown by default — it must be explicitly enabled via `--columns +size`. When present, a summary footer row displays the total size across all worktrees. The column appears after Path (canonical position 4) and works across list, sync, and prune commands. Size computation uses inode tracking to count hard-linked files only once (matching `du` behavior) and uses symlink_metadata to avoid following symlinks. Unreadable files are silently skipped for resilience. Shell completions updated for all four shells (also adds missing `owner`). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add size to valid column names, document it as optional (not in defaults), and add +size example to modifier mode section. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The summary footer now subtracts pruned worktrees from the total, so the displayed size updates as worktrees are removed during sync and prune operations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Mar 17, 2026
Closed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sizecolumn showing the disk size of each worktree folder in human-readable format (e.g.42K,1.3M,2.5G)--columns +sizeDetails
The column sits at canonical position 4 (after Path, before Base). Size computation:
dubehavior)symlink_metadatato avoid following symlinksJSON output wraps in
{"worktrees": [...], "total_size_bytes": N, "total_size": "X.YG"}when size is selected, preserving backward compatibility when it's not.Shell completions updated for all four shells (also fixes missing
ownerentries).Test plan
cargo clippy— zero warningscargo test— 663 passed, 0 failedcargo fmt— cleangit worktree-list --columns +sizeshows Size column after Path with summary footergit worktree-list(default) does not show Size columngit worktree-list --columns +size --jsonwraps output with totaldaft sync --columns +sizeshows size in TUIdaft prune --columns +sizeshows size in TUI🤖 Generated with Claude Code