Skip to content

Add worktree status tracking to list command#5

Merged
agarcher merged 1 commit intomainfrom
better-status
Jan 11, 2026
Merged

Add worktree status tracking to list command#5
agarcher merged 1 commit intomainfrom
better-status

Conversation

@agarcher
Copy link
Owner

Summary

  • Add enhanced status information to wt list showing commits ahead/behind main branch with ↑↓ arrows
  • Show [uncommitted], [new], or [merged] status indicators with clear priority
  • Store worktree creation metadata (timestamp and initial commit) in git config
  • Add -v/--verbose flag for detailed multi-line output including worktree age
  • Add STATUS column header in compact list output

Status Priority

New worktrees that haven't had any changes committed show [new] instead of being incorrectly marked as [merged]. The status priority is:

  1. [uncommitted] - has uncommitted changes
  2. [new] - still on initial commit (no changes committed yet)
  3. [merged] - branch has been merged to main

Example Output

Compact (default):

  NAME                  BRANCH                         STATUS
* my-feature           feature/foo                    [new]
  with-changes         feature/bar                    ↑1 [uncommitted]
  done-branch          feature/baz                    [merged]

Verbose (-v):

================================================================================
* my-feature
  Branch: feature/foo
  Age: 3 days
  Status: new
================================================================================

Test plan

  • All existing tests pass
  • New tests for initial commit storage and IsNew status
  • make lint passes
  • make build succeeds

🤖 Generated with Claude Code

- Show commits ahead/behind main branch with ↑↓ arrows
- Show [uncommitted] and [merged] status indicators
- Store worktree creation time in git config for age tracking
- Add -v/--verbose flag for detailed multi-line output with age
- Fix unchecked fmt.Fprint return in init command

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@agarcher agarcher merged commit 4bddd68 into main Jan 11, 2026
4 checks passed
@agarcher agarcher deleted the better-status branch January 11, 2026 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant