Fix autocd support for git worktrees - #364
pellejacobs wants to merge 1 commit into
Conversation
scmbreeze#353 introduced support for git worktrees. However, autocd seems broken on unix systems as bash variables are case sensitive on unix. Therefore, when trying to cd into a worktree through `gco 1`, the error `fatal: 'worktree-name' is already checked out at '/path/to/worktree`.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA single variable reference is corrected in the git branch shortcuts function. The ChangesGit Checkout Shortcuts Variable Reference
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
|
Dang should've looked in PRs first but I also fixed more broadly - #366 - I'm not sure it's just the upcasing since in my investigation the |
…e :) (#371) #### Problem I wanted to get git worktrees into an scm breez-ish way and along the way I found a bug-ish thing in interactions between ClaudeCode and scm breeze and also added some niceties to the repo. #### What - Full worktree support in scm breezish way - `gwt` `gwta` `gwtr` aliases, you can pass `gco 2` and it knows to cd to the directory for you - Concept of worktree `sibling` or `feature` or just a different directory you want as default instead of `git` defaulting to directory you're in (more documentation near the setting in code) - Non-private `_` fns moved to `__` to help with a ClaudeCode quirk - Docker 'testing' helper so I could isolate from my local scrips more easily - helps with multiple shell types (bash and zsh) testing - Pulled in an outstanding fix for `git rev-parse --show-toplevel` - Fixed several worktree bugs in scm breeze, ie. #364 is accidentally fixed by my refactors and I also intentionally fixed where a `/` in the name didn't work correctly. #### Why - I'm using worktrees more with ai and I love scm breeze features/shortcuts etc - I'm annoyed with worktree default of being in the current directory - it just isn't how my brain wants it organized and thought maybe others felt this way - I spent a lot of time debugging ClaudeCode not being able to call my `ls` and `cat` because I wrapped in the super helpful `_scmb_git_branch_shortcuts` but ClaudeCode ignores all single `_` fns and it caused a lot of pain so I renamed _only_ the fns that are used in a non-private way to have `__` in front. - I was having trouble testing local b/c I couldn't tell if a quirk was in my extra shell fns or in scm breeze so created a docker tester to help - also helpful it supports bash and zsh so you can easily test different shells - I just saw #365 and seemed reasonable to pull in to my fork - Bugs are annoying! <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a Docker sandbox for trying the tool in an isolated environment, with build/run instructions and an included shell session. * Added shortcuts for working with git worktrees, including creating, removing, and switching more naturally between branches and their worktrees. * **Bug Fixes** * Improved path handling for status-related shortcuts so file paths resolve from the correct project root. * **Documentation** * Expanded the README with a new Docker sandbox section. * **Tests** * Updated coverage to match the improved command evaluation behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
Hi @pellejacobs - think I improved on what you proposed #371 and it's been merged fyi if you care to close. |
#353 introduced support for git worktrees. However, autocd seems broken on unix systems as bash variables
are case sensitive on unix.
Therefore, when trying to cd into a worktree through
gco 1, the errorfatal: 'worktree-name' is already checked out at '/path/to/worktree.Summary by CodeRabbit