- Notifications
You must be signed in to change notification settings - Fork 45
Migrate to git gtr subcommand (resolves coreutils conflict)#19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Conversation
helizaga commented Nov 17, 2025 • edited by coderabbitai bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by coderabbitai bot
Uh oh!
There was an error while loading. Please reload this page.
- Updated CLAUDE.md, CONTRIBUTING.md, and README.md to reflect the renaming of the command from `gtr` to `git gtr` to avoid conflicts with GNU coreutils. - Adjusted examples and command usage throughout the documentation to ensure consistency. - Enhanced shell completion scripts for Bash, Zsh, and Fish to support the new command structure. - Updated setup scripts and instructions to guide users on the new command format.
coderabbitaibot commented Nov 17, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
📝 WalkthroughWalkthroughThe pull request renames the CLI interface from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
bin/gtr (3)
239-242: Inconsistent command references - missing "git" prefix.The "Next steps" output still uses the old
gtrcommand format without thegitprefix. This is inconsistent with the rest of the migration and could confuse users.Apply this diff to fix the inconsistency:
- echo " gtr editor $branch_name # Open in editor"- echo " gtr ai $branch_name # Start AI tool"- echo " cd \"\$(gtr go $branch_name)\" # Navigate to worktree"+ echo " git gtr editor $branch_name # Open in editor"+ echo " git gtr ai $branch_name # Start AI tool"+ echo " cd \"\$(git gtr go $branch_name)\" # Navigate to worktree"
463-463: Inconsistent command reference in error message.The error message still uses
gtr configinstead ofgit gtr config.Apply this diff:
- log_info "Set default: gtr config set gtr.ai.default claude"+ log_info "Set default: git gtr config set gtr.ai.default claude"
750-751: Inconsistent command references in adapter tip.The tip message still uses
gtr configinstead ofgit gtr config.Apply this diff:
- echo " gtr config set gtr.editor.default <name>"- echo " gtr config set gtr.ai.default <name>"+ echo " git gtr config set gtr.editor.default <name>"+ echo " git gtr config set gtr.ai.default <name>"README.md (1)
117-117: Fix inconsistent symlink target in installation instructions.Line 117 creates a symlink to
/usr/local/bin/gtr, but line 31 creates a symlink to/usr/local/bin/git-gtr. This directly contradicts the PR's goal of renaming fromgtrtogit gtrto avoid GNU coreutils conflicts. Both instructions should use the same target.Apply this diff to align with the migration to
git gtr:-sudo ln -s "$(pwd)/bin/gtr" /usr/local/bin/gtr+sudo ln -s "$(pwd)/bin/git-gtr" /usr/local/bin/git-gtr
🧹 Nitpick comments (1)
.github/instructions/completions.instructions.md (1)
131-131: Clarify Fish shell completion syntax for git subcommands.The note at line 131 mentions "Uses declarative
complete -c gtrsyntax," but sincegtris now invoked asgit gtr(a git subcommand), the Fish completion syntax may differ from standalone commands. Verify whether this line should mention git-specific completion predicates (e.g.,__fish_seen_subcommand_fromor similar git subcommand handling).Please verify the actual Fish completion implementation in
completions/gtr.fishto confirm whether the syntax described here accurately reflects how git subcommands are handled.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (10)
.github/instructions/completions.instructions.md(6 hunks)CLAUDE.md(8 hunks)CONTRIBUTING.md(2 hunks)README.md(19 hunks)bin/git-gtr(1 hunks)bin/gtr(12 hunks)completions/_gtr(4 hunks)completions/gtr.bash(2 hunks)completions/gtr.fish(2 hunks)templates/setup-example.sh(2 hunks)
🧰 Additional context used
🪛 Shellcheck (0.11.0)
completions/gtr.bash
[warning] 13-13: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
(SC2207)
[warning] 46-46: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
(SC2207)
🔇 Additional comments (9)
completions/_gtr (1)
1-77: LGTM! Zsh completion correctly migrated to git subcommand.The completion function is properly renamed to
_git-gtrfollowing zsh conventions for git subcommands, and the config actions have been appropriately extended to include "add".templates/setup-example.sh (1)
1-35: LGTM! Setup script messaging updated consistently.All user-facing references to the command have been updated to
git gtr.bin/git-gtr (1)
5-15: LGTM! Symlink resolution correctly implemented.The wrapper properly resolves symlinks to locate the actual
gtrbinary in the same directory. This ensuresgit gtrworks correctly regardless of how the script is installed (direct or via symlink).bin/gtr (1)
8-8: LGTM! Version bump to 2.0.0 is appropriate.The version bump to 2.0.0 correctly reflects the breaking change of migrating from
gtrtogit gtras a git subcommand.CONTRIBUTING.md (1)
3-3: LGTM! Contributing guide updated consistently.The references to the command have been updated to
git gtrin the introduction and testing checklist.Also applies to: 181-182
CLAUDE.md (1)
7-7: LGTM! Claude documentation comprehensively updated.All command references, examples, and descriptions have been consistently updated to reflect the new
git gtrsubcommand structure.Also applies to: 93-101, 174-174, 194-213, 237-237
completions/gtr.bash (1)
1-52: LGTM! Bash completion correctly migrated to git subcommand.The completion function has been properly updated:
- Function renamed to
_git_gtrfor git subcommand integration- Word indexing adjusted correctly for
git gtrcontext (cword == 2 for subcommand, etc.)- Config actions extended to include "add"
- Flag completion logic added for better UX
Note: The Shellcheck warnings (SC2207) about using
compgenare false positives - this is the standard bash completion pattern and the usage is correct.completions/gtr.fish (2)
4-22: LGTM! Helper functions correctly implement git subcommand detection.The new helper functions properly check for the
git gtrcontext:
__fish_git_gtr_needs_commanddetects when completing aftergit gtr__fish_git_gtr_using_commandvalidates specific subcommand context
25-79: LGTM! Fish completions fully migrated to git subcommand.All completion entries have been updated to:
- Use
-c gitinstead of-c gtr- Use the new predicate functions for context detection
- Include "add" in config actions (matching bash/zsh)
- Maintain consistent completion behavior for the new command structure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
README.md (1)
634-647: Consider updating the architecture diagram.The architecture section currently shows only
bin/gtras the main executable. With the migration togit gtr, users now interact withbin/git-gtr(the git subcommand wrapper) which delegates tobin/gtr. Consider updating this section to reflect both files for clarity.For example:
git-worktree-runner/ -├── bin/gtr # Main executable+├── bin/+│ ├── git-gtr # Git subcommand entry point+│ └── gtr # Core implementation ├── lib/ # Core libraries
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
README.md(20 hunks)bin/gtr(16 hunks)
🔇 Additional comments (10)
bin/gtr (4)
8-8: LGTM! Version bump appropriate for breaking change.The major version bump to 2.0.0 correctly signals the breaking change from
gtrtogit gtrcommand structure.
94-94: LGTM! User-facing messages consistently updated.All error messages, usage strings, and help hints have been systematically updated from
gtrtogit gtr. The changes maintain consistent formatting and accurately reflect the new command structure.Also applies to: 101-101, 278-278, 332-332, 387-387, 451-451, 609-609, 750-751, 791-791, 798-798, 806-806, 814-814, 822-822
167-167: LGTM! Example commands updated correctly.All inline examples and "next steps" suggestions have been updated to use the
git gtrcommand prefix, maintaining clarity and consistency with the new subcommand structure.Also applies to: 169-169, 239-241, 463-463, 560-560
887-1024: LGTM! Help documentation comprehensively updated.The complete help text has been systematically migrated to the
git gtrcommand structure. All sections—quick start, command descriptions, workflow examples, and configuration—consistently reflect the new subcommand format while maintaining clarity and usability.README.md (6)
5-6: LGTM! Clear breaking change notice.The prominent warning at the top of the README effectively communicates the v2.0 migration from
gtrtogit gtr, provides clear guidance, and links to release notes for additional details.
31-31: LGTM! Installation instructions correctly updated.The symlink instructions properly reference
bin/git-gtr, which follows the standard git subcommand pattern wheregit <command>looks forgit-<command>in PATH.Also applies to: 117-117
38-46: LGTM! Command examples consistently updated.All usage examples in the quick start and command reference sections have been systematically updated to use the
git gtrprefix. The examples remain clear, practical, and consistent with the new subcommand structure.Also applies to: 83-99, 163-168, 185-198, 205-217, 230-233, 237-241
52-62: LGTM! Comparison table accurately updated.The feature comparison table correctly reflects the migration, with all
git gtrexamples in the right column updated to use the new subcommand format. The comparison remains clear and accurate.
302-322: LGTM! Configuration examples properly updated.All configuration commands and examples throughout the README have been updated to use
git gtr config. The AI tool table, file copying patterns, hooks, and configuration sections all consistently reflect the new command structure.Also applies to: 330-364, 376-389, 396-425
433-520: LGTM! Workflow examples and advanced usage thoroughly updated.The advanced usage sections, including repository scoping, multi-branch workflows, custom hooks, parallel development with
--force, and troubleshooting, have all been comprehensively updated to use thegit gtrcommand structure while maintaining clarity and accuracy.Also applies to: 543-577, 591-605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.github/instructions/completions.instructions.md (1)
101-108: Clarify the distinction between bin/git-gtr and bin/gtr in examples.Line 105 references updating help text in
bin/gtr, which is the core implementation. For consistency with the PR objective and to help maintainers, it would be clearer to briefly note thatbin/git-gtris the public entry point (wrapper) andbin/gtrcontains the core logic. This context helps explain why help updates go intobin/gtrspecifically.README.md (1)
20-62: Minor: Consider updating narrative references from "gtr" to "git gtr" for consistency.Lines 22, 48, and 431 contain narrative references to "gtr" (e.g., "Enter gtr", "Why gtr?", "gtr is repository-scoped"). While these are section titles and descriptive text rather than command references, updating them to "git gtr" would maintain consistency throughout the documentation with the PR's goal to fully rename the command.
This is optional—the command examples and configuration are all correct. The narrative references are recognizable context either way.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
.github/instructions/completions.instructions.md(7 hunks)README.md(21 hunks)
🔇 Additional comments (5)
.github/instructions/completions.instructions.md (1)
40-55: LGTM - Shell completion testing examples are well-updated.The manual testing section correctly reflects the new
git gtrcommand structure across all three shells. The commands are clear and actionable.README.md (4)
5-5: Well-presented breaking change notice.The v2.0.0 breaking change notice is prominent, clear, and provides a link to release notes. This helps users quickly understand the migration path.
158-240: Command reference is thorough and consistently updated.All command documentation clearly shows the
git gtrformat with practical examples. The command options, flags, and use cases are well-documented. Configuration examples correctly show bothgit gtr config setcommand usage and internalgtr.*key naming.
375-425: Configuration and setup examples are clear and consistent.The distinction between internal configuration keys (
gtr.*) and public commands (git gtr config) is clear. Real-world examples for Node.js, Python, Ruby, and Rust are practical and help users get started quickly.
630-649: Architecture section clearly documents the dual-bin design.The architecture diagram effectively shows the distinction between
bin/git-gtr(the git subcommand entry point/wrapper) andbin/gtr(the core implementation). This supports understanding the PR's structural changes and the public surface rename.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/PULL_REQUEST_TEMPLATE.md (1)
17-17: Consider improving verb formality for consistency.Line 17 uses "fixes an issue" which is slightly informal for a contributor template. Consider rewording to align with more formal phrasing used in similar templates:
-- [ ] Bug fix (non-breaking change that fixes an issue)+- [ ] Bug fix (non-breaking change that resolves an issue)This minor adjustment improves consistency and formality across the template.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.github/PULL_REQUEST_TEMPLATE.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
.github/PULL_REQUEST_TEMPLATE.md
[style] ~17-~17: Consider using a different verb for a more formal wording.
Context: ...- [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaki...
(FIX_RESOLVE)
🔇 Additional comments (1)
.github/PULL_REQUEST_TEMPLATE.md (1)
1-92: Well-structured PR template that properly guides contributors on the newgit gtrcommand format.The template provides clear sections for describing changes, testing requirements, and contributor checklists. The inclusion of both production (
git gtr) and development (./bin/gtr) command guidance aligns well with the PR objectives and development workflow.Key strengths:
- Platform-specific testing checklist (macOS, Linux, Windows)
- Comprehensive functional test coverage for all main commands
- Explicit mention of testing shell completions
- Clear expectations around breaking changes and documentation updates
- Emphasis on testing both command surfaces
- Updated README.md to clarify prerequisites for Bash and Zsh completions, including the need for git's completion system. - Improved completion instructions in completions.instructions.md to reflect changes in command structure and added details for testing completions. - Modified completion scripts for Bash, Zsh, and Fish to integrate better with their respective completion systems and added instructions for installation and usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
.github/instructions/completions.instructions.md(6 hunks)README.md(23 hunks)completions/_gtr(4 hunks)completions/gtr.bash(2 hunks)completions/gtr.fish(2 hunks)
🧰 Additional context used
🪛 Shellcheck (0.11.0)
completions/gtr.bash
[warning] 25-25: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
(SC2207)
[warning] 58-58: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
(SC2207)
Uh oh!
There was an error while loading. Please reload this page.
- Renamed Zsh completion file from `_gtr` to `_git-gtr` for consistency with command structure. - Updated references in README.md, completions.instructions.md, and editor.instructions.md to reflect the new file name. - Added the new `_git-gtr` completion script to enhance Zsh support for `git gtr` commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
README.md (1)
142-157: Comprehensive Zsh setup instructions.The Zsh completion setup is detailed and correct. The heredoc approach (lines 150-154) for updating
.zshrcis user-friendly.Consider adding a verification step to ensure git's zsh completion is already installed, since this is a prerequisite mentioned on line 142:
# Verify git's zsh completion is availabletype _git >/dev/null 2>&1&&echo"Git completion available"||echo"Install git completion first"CLAUDE.md (1)
198-204: Document security considerations for environment variables.The Generic Adapter Fallback using
eval(line 203) is a pragmatic solution for handling multi-word commands. Since these environment variables (GTR_EDITOR_CMD,GTR_AI_CMD) are user-configured, the security risk is acceptable.Consider adding a brief security note in the documentation clarifying that these environment variables should only be set by the user themselves, not by scripts or untrusted sources.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
.github/instructions/completions.instructions.md(5 hunks).github/instructions/editor.instructions.md(1 hunks)CLAUDE.md(12 hunks)README.md(23 hunks)completions/_git-gtr(5 hunks)
🔇 Additional comments (12)
completions/_git-gtr (3)
1-6: LGTM! Correct git subcommand completion setup.The changes properly adapt the completion for git's subcommand structure. The
#compdef git-gtrdirective and_git_gtr()function naming follow Zsh conventions correctly.
83-83: Clear documentation comment.The note about auto-discovery is helpful. Git's completion system will automatically invoke
_git_gtr()when completinggit gtr, so no manual invocation is needed.
51-51: No issues found — config 'add' action is fully implemented.Verification confirms the complete implementation chain:
- The completion includes the 'add' action (completions/_git-gtr:51)
- The cmd_config function routes 'add' requests (bin/gtr:804-811)
- The cfg_add helper function handles the operation (lib/config.sh:96) with proper scope support (local, global, system)
The syntax
git gtr config add <key> <value>is fully functional and correctly reflected in the completion.README.md (3)
5-6: Excellent breaking change notice.The prominent warning about the v2.0.0 rename is well-placed and includes a link to release notes. This will help users understand the migration.
170-252: LGTM! Consistent command documentation.All command examples correctly use the
git gtrprefix throughout. The documentation is clear and comprehensive, with good examples for each command.
645-661: Clear architecture documentation.The directory structure accurately reflects the new dual-binary setup with
git-gtras the wrapper andgtras the core implementation. This helps developers understand the system organization..github/instructions/completions.instructions.md (2)
2-9: LGTM! Correct file naming conventions.The completion files follow shell-specific conventions correctly:
- Bash:
gtr.bash(sourced directly)- Zsh:
_git-gtr(underscore prefix, placed in fpath)- Fish:
gtr.fish(symlinked to completions directory)
66-67: Important prerequisite documented.The note about requiring git's own completion system is crucial and well-placed. This dependency should be understood by anyone implementing or using these completions.
.github/instructions/editor.instructions.md (1)
32-32: LGTM! Correct file reference update.The completion file reference is correctly updated from
_gtrto_git-gtr, consistent with the Zsh completion file rename throughout the PR.CLAUDE.md (3)
7-20: Excellent developer documentation.The distinction between production use (
git gtr) and development/testing (./bin/gtr) is clearly explained. The binary structure section helps developers understand the wrapper pattern immediately.
373-389: Comprehensive environment variable documentation.The new environment variables section is excellent. It clearly distinguishes between system environment variables (for configuring gtr) and hook environment variables (available in hook scripts). This will help developers and advanced users understand the full configuration surface.
79-115: Clear testing workflow documentation.The manual testing workflow correctly uses
./bin/gtrfor direct script execution during development. The examples are comprehensive and cover all major functionality, which is especially important given the lack of automated tests.
fae9160 into mainUh oh!
There was an error while loading. Please reload this page.
gtrtogit gtrto avoid conflicts with GNU coreutils.Summary by CodeRabbit
New Features
git gtrprefix (v2.0.0 release)Documentation