Five PRs from my breezier branch that ghthor recommended I open here :) - #371
Conversation
…rivate Fix ClaudeCode ignoring _ functions as "private"
…de-git-checkout Improve worktree inside git checkout.
…late Mcrockett/gwt alias and pr template
* Improve worktree inside git checkout. * Add gwt alias, pr template. * Checkout handles worktree branch name. * Add docker test area.
* Checkout handles worktree branch name. * git worktree add with a touch more functionality. * More aliases * Correct merge * Fix for / in branch name * Break out internal _scmb_git fn * worktree remove handles branch name * Add number support generally to worktree * Fix ClaudeCode ignoring _ functions as "private" * Cleanup... * Remove duplicate functions. * split some functions.
The ruby version moved some time ago to --show-toplevel.... Co-authored-by: Russell Mora <russell.mora@nokia.com>
📝 WalkthroughWalkthroughThis PR adds git worktree shortcut support (checkout, add, remove) with new aliases and helper functions, renames the internal ChangesGit worktree shortcuts and safe-eval rename
Docker sandbox environment
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant CheckoutShortcuts as __scmb_git_checkout_shortcuts
participant WorktreeLookup as __scmb_git_worktree_path_for_branch
participant GitCLI as git
User->>CheckoutShortcuts: git co feature-branch
CheckoutShortcuts->>WorktreeLookup: find worktree for feature-branch
WorktreeLookup->>GitCLI: git worktree list --porcelain
GitCLI-->>WorktreeLookup: worktree paths
alt worktree exists
WorktreeLookup-->>CheckoutShortcuts: path
CheckoutShortcuts->>CheckoutShortcuts: cd into worktree
else no worktree
CheckoutShortcuts->>GitCLI: __safe_eval git checkout feature-branch
end
sequenceDiagram
participant User
participant DockerCLI as docker
participant Entrypoint as entrypoint.sh
participant SandboxRepo as sandbox-repo
User->>DockerCLI: docker run scm-breeze-sandbox
DockerCLI->>Entrypoint: exec entrypoint.sh bash
Entrypoint->>Entrypoint: run /workspace/install.sh once
Entrypoint->>SandboxRepo: init throwaway git repo if missing
Entrypoint->>User: print usage banner
Entrypoint->>DockerCLI: exec "$@" (bash)
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
I still need to test whether ghthor comment to me "https://github.com/mmcrockett/scm_breeze/blob/67a45317f46a4c2af62bb742b5a51d42e31056a7/lib/git/branch_shortcuts.sh#L65 - Does this result in an args value being added to the shell env?" |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
git.scmbrc.example (1)
112-120: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMissing
featuremode ingit_worktree_directorydocs.The comment documents
"","sibling", and an explicit directory path, but the implementation (__scmb_git_worktree_target_pathinlib/git/branch_shortcuts.sh) also supports a"feature"mode that nests the repo's worktree inside a<name>directory. Users configuring this file have no way to discover that option.📝 Proposed doc fix
git_worktree_alias="gwt" # Controls where `gwt add <name>` places the new worktree. # "" (default) - pass through to native `git worktree add` # "sibling" - create "<repo-basename>-<name>" next to the repo +# "feature" - create "<name>/<repo-basename>" next to the repo, +# nesting the worktree so multiple repos can share +# one feature directory # "/some/dir" - create "/some/dir/<repo-basename>-<name>" # In all non-empty modes the new branch is named <name>. git_worktree_directory=""🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@git.scmbrc.example` around lines 112 - 120, Update the git_worktree_directory documentation comment to include the supported "feature" mode alongside "", "sibling", and explicit paths. Reference the existing git_worktree_directory setting and keep the description aligned with __scmb_git_worktree_target_path in lib/git/branch_shortcuts.sh so users can discover that <name>/<repo-basename> worktree layout option.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docker/Dockerfile`:
- Around line 3-15: The Dockerfile package install step will fail because
`shunit2` is in Alpine’s community repository, not main. Update the `RUN apk add
--no-cache` block in the Dockerfile to enable the Alpine community repo before
installing packages, then keep the existing package list including `shunit2`
unchanged. Use the same Dockerfile install section so the repo is configured
prior to the `apk add` call.
In `@docker/entrypoint.sh`:
- Around line 4-11: The install flow in entrypoint.sh is marking scm_breeze as
installed even when /workspace/install.sh fails, because the failure is
swallowed and the marker is touched unconditionally. Update the logic around the
/workspace/install.sh invocation so the .scm_breeze_installed file is only
created after a successful install, and keep the existing warning path for
missing /workspace/install.sh; use the install block itself as the place to gate
the touch so failures in the entrypoint do not suppress future retries.
- Around line 13-25: The sandbox setup in entrypoint.sh creates only an unstaged
README.md edit and an untracked file, so it does not match the documented
staged/unstaged/untracked state. Update the setup in the sandbox-repo
initialization block to leave one file staged after the initial commit, using
the existing git init/git add/git commit flow and the README.md/new.txt setup as
the anchor points. Make sure the final repo state includes a staged change in
addition to the current unstaged modification and untracked file.
In `@README.md`:
- Around line 69-71: The README wording is out of sync with the sandbox setup
created by docker/entrypoint.sh: it should not claim the repo is pre-populated
with staged changes if the entrypoint only creates an unstaged modification and
an untracked file. Update the documentation text to match the actual behavior
produced by the entrypoint script, and use the same terminology as the setup
logic so the description stays accurate if the script changes.
---
Nitpick comments:
In `@git.scmbrc.example`:
- Around line 112-120: Update the git_worktree_directory documentation comment
to include the supported "feature" mode alongside "", "sibling", and explicit
paths. Reference the existing git_worktree_directory setting and keep the
description aligned with __scmb_git_worktree_target_path in
lib/git/branch_shortcuts.sh so users can discover that <name>/<repo-basename>
worktree layout option.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 59f05bb0-a298-4fe6-8530-b1b9a37b5f5c
📒 Files selected for processing (12)
README.mddocker/Dockerfiledocker/entrypoint.shgit.scmbrc.examplelib/git/aliases.shlib/git/branch_shortcuts.shlib/git/fallback/status_shortcuts_shell.shlib/git/helpers.shlib/git/status_shortcuts.shlib/scm_breeze.shpull_request_template.mdtest/lib/scm_breeze_test.sh
|
Thanks for merging ghthor - sorry been lost in other stuff and haven't tested your suggestion. |
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
gwtgwtagwtraliases, you can passgco 2and it knows to cd to the directory for yousiblingorfeatureor just a different directory you want as default instead ofgitdefaulting to directory you're in (more documentation near the setting in code)_fns moved to__to help with a ClaudeCode quirkgit rev-parse --show-toplevel/in the name didn't work correctly.Why
lsandcatbecause I wrapped in the super helpful_scmb_git_branch_shortcutsbut 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.Summary by CodeRabbit