fix: display folder name instead of branch name in remove command#53
Conversation
The remove command was showing the current branch name instead of the folder name being removed. This was confusing when: - Branch names contain slashes (feature/auth -> folder feature-auth) - A different branch was checked out in the worktree - Custom --name suffix was used Since git gtr rm removes a folder (worktree), the log message should show what's actually being removed, consistent with the create command. Fixes coderabbitai#52
WalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (2)bin/gtr📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
{bin/gtr,lib/**/*.sh,adapters/**/*.sh}📄 CodeRabbit inference engine (.github/instructions/testing.instructions.md)
Files:
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Pull Request
Description
Fix the remove command to display the folder name instead of the current branch name in the log message, making it consistent with the create command.
Motivation
The remove command was displaying the current branch name (
$branch_name) instead of the folder name being removed. This was confusing when:feature/auth→ folderfeature-auth)--namesuffix was used during creationSince
git gtr rmremoves a folder (worktree), the log message should show what is actually being removed.Fixes #52
Type of Change
Testing
Manual Testing Checklist
Tested on:
Core functionality tested:
git gtr new <branch>- Create worktreegit gtr go <branch>- Navigate to worktreegit gtr editor <branch>- Open in editor (if applicable)git gtr ai <branch>- Start AI tool (if applicable)git gtr rm <branch>- Remove worktreegit gtr list- List worktreesgit gtr config- Configuration commands (if applicable)Test Steps
git gtr new feature/testgit gtr rm feature/test==> Removing worktree: feature-testExpected behavior: Log message shows folder name being removed.
Actual behavior: Log message now correctly shows folder name.
Additional tests:
--namesuffix - shows full folder name (verified)Breaking Changes
Checklist
Before submitting this PR, please check:
git gtr(production) and./bin/gtr(development)Additional Context
The fix uses
$(basename "$worktree_path")which follows existing codebase conventions (e.g., line 858 uses the same inline pattern for log messages).License Acknowledgment
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache License 2.0.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.