feat: improve wt recent command error handling and performance#12
feat: improve wt recent command error handling and performance#12
Conversation
- Add verbose flag (-v, --verbose) to wt recent command - Track and report skipped branches with detailed reasons - Replace silent failures with structured error reporting - Users get clear feedback when branches are skipped Technical implementation: - Added branchCollectionResult struct to track skipped branches - Modified collectBranchInfo to return detailed error tracking - Enhanced handleRecentCommand to display skipped branch summary - Added verbose flag documentation to help system Fixes issue where branches with no commits were silently ignored, providing better transparency and debugging capability. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Extract displayNoBranchesMessage helper function - Extract displaySkippedBranchesIfVerbose helper function - Reduce cognitive complexity from 22 to acceptable levels - Fix golangci-lint constant usage issues in tests Technical changes: - Moved error display logic to dedicated helper functions - Fixed test constants to use testUser consistently - Maintained all existing functionality and error handling - All tests passing with comprehensive coverage 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Mark task-18 as completed with implementation notes - Mark task-19 as completed with comprehensive test coverage details - Document all acceptance criteria as fulfilled - Update task status and implementation details 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add task for future optimization of worktree info caching in wt recent command. Related to current recent command improvements but depends on performance benchmarking (task-22) to be completed first. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Based on previous experience, interactive mode didn't work well for this use case. The current numeric navigation (e.g., wt recent 2) provides a faster workflow that better fits the command-line nature of the tool. Users needing interactive selection can pipe output to tools like fzf. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive benchmark tests for 100-10,000 branches - Benchmark different flag combinations (--all, --others, -v) - Create helper functions to generate test repositories - Document performance characteristics in BENCHMARKS.md - Results show excellent performance even with large branch counts Implements task-22
|
Claude finished @tobiase's task —— View job PR Review Analysis
|

Summary
This PR improves the
wt recentcommand with better error handling, comprehensive tests, and performance benchmarks.Implemented Tasks
task-18: Improved error handling with verbose flag
--verboseflag to show detailed information about skipped branchestask-19: Added comprehensive test coverage
recent_test.gowith extensive test casestask-20: Fixed string formatting for long branch names
task-22: Added performance benchmarks
recent_bench_test.gowith comprehensive benchmarksBENCHMARKS.mdtask-23: Closed as won't implement
wt recent 2) provides efficient workflowChanges
handleRecentCommandto reduce cognitive complexity from 65 to acceptable levelsTest Plan
Performance
Benchmark results show excellent performance:
The main bottleneck remains git operations, not our Go code.