Skip to content

feat(worktree): add filter mode for worktree-clean (#158) - #160

Merged
gerchowl merged 3 commits into
devfrom
feature/158-worktree-clean-filter-mode
Feb 24, 2026
Merged

gerchowl merged 3 commits into
devfrom
feature/158-worktree-clean-filter-mode

Conversation

@gerchowl

Copy link
Copy Markdown
Contributor

Description

Adds a mode parameter to worktree-clean so the default cleans only stopped worktrees (no running tmux session), while just worktree-clean all retains the previous behavior (clean all worktrees). Summary output shows what was cleaned vs skipped.

Type of Change

  • feat -- New feature
  • fix -- Bug fix
  • docs -- Documentation only
  • chore -- Maintenance task (deps, config, etc.)
  • refactor -- Code restructuring (no behavior change)
  • test -- Adding or updating tests
  • ci -- CI/CD pipeline changes
  • build -- Build system or dependency changes
  • revert -- Reverts a previous commit
  • style -- Code style (formatting, whitespace)

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • justfile.worktree: Add mode="" parameter to worktree-clean; stopped-only logic skips dirs with running tmux sessions; all mode retains previous behavior with warning; summary output (cleaned vs skipped)
  • assets/workspace/.devcontainer/justfile.worktree: Synced via manifest
  • tests/bats/worktree.bats: BATS tests for stopped-only, all mode, invalid mode, wt-clean alias
  • CHANGELOG.md: Entry under Changed

Changelog Entry

Changed

  • worktree-clean: add filter mode for stopped-only vs all (#158)
    • Default just worktree-clean (no args) now cleans only stopped worktrees, skips running tmux sessions
    • just worktree-clean all retains previous behavior (clean all worktrees) with warning
    • Summary output shows cleaned vs skipped worktrees
    • just wt-clean alias unchanged

Testing

  • Tests pass locally (just test)
  • Manual testing performed (describe below)

Manual Testing Details

  • just worktree-clean (no args): cleaned only stopped worktrees, skipped running session
  • just worktree-clean all: cleaned all worktrees including running sessions
  • just wt-clean and just wt-clean all: alias works
  • just worktree-clean invalid: exits with error
  • BATS: just test-bats — all 238 tests pass including 4 new worktree-clean tests

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (edit docs/templates/, then run just docs)
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

Design and implementation plan posted on issue #158.

Refs: #158

gerchowl and others added 2 commits February 23, 2026 09:01
- Default: clean only stopped worktrees, skip running tmux sessions
- 'all' mode: clean all worktrees (previous behavior) with warning
- Summary output: cleaned vs skipped
- BATS tests for stopped-only, all mode, invalid mode, wt-clean alias

Refs: #158
Co-authored-by: Cursor <[email protected]>
@gerchowl
gerchowl merged commit 487c052 into dev Feb 24, 2026
10 checks passed
@gerchowl
gerchowl deleted the feature/158-worktree-clean-filter-mode branch February 24, 2026 12:47
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