Skip to content

Conversation

@laysakura
Copy link
Contributor

Summary

  • Enhanced sprout path command to accept index numbers in addition to branch names
  • Users can now use index numbers shown in sprout ls output with the path command
  • Fixed a bug where git branch names with "refs/heads/" prefix weren't handled correctly

Changes

  • Modified sprout path command to accept identifiers (branch name or index)
  • Updated CLI argument type from BranchName to str to accept indices
  • Added proper error handling for invalid indices
  • Fixed branch name parsing in get_indexed_worktrees() to strip "refs/heads/" prefix
  • Added comprehensive tests for the new functionality

Test plan

  • Run make test - all tests pass
  • Run make lint - no linting issues
  • Test sprout ls shows index numbers correctly
  • Test sprout path 1 returns correct path for first worktree
  • Test sprout path <branch-name> still works as before
  • Test sprout path 99 shows appropriate error message for invalid index
  • Test sprout rm <index> still works (was already implemented)

🤖 Generated with Claude Code

laysakura and others added 4 commits June 27, 2025 21:53
- Document index numbers in sprout ls output
- Show examples of using indices with rm and path commands
- Improve CHANGELOG entry to explain the user benefit clearly

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Changed sort key to use 'or' operator instead of nested get() calls
to ensure the lambda always returns a string, never None.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@laysakura laysakura merged commit 4ce028e into main Jun 27, 2025
7 checks passed
@laysakura laysakura deleted the feat-index branch June 27, 2025 13: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.

2 participants