Conversation
Copy `mise.toml` and `mise.local.toml` from the source project into each new worktree when running `worktree create`. For single-repo projects the files are copied from the project root; for multi-repo projects they are copied from each sub-repo root. This lets mise-managed tool version pinning (PHP, Node.js, .NET, etc.) follow the worktree even when the config is gitignored (`mise.local.toml` is the common case). Copies are skipped when the destination already has the file, so tracked `mise.toml` provided by `git worktree add` is preserved. Refs: #12 Co-Authored-By: Claude <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 52 minutes and 57 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughworktree 作成時に Changes
Sequence DiagramsequenceDiagram
participant User
participant cmd_create as lib/cmd_create.sh
participant repo as Repository
participant copy as copy_mise_configs
participant hook as .worktreerc hook
participant deps as Dependency Install
User->>cmd_create: worktree create
cmd_create->>repo: Create worktree directory
cmd_create->>cmd_create: Add repo to created_repos list
loop For each created repo
cmd_create->>copy: copy_mise_configs(src, dest)
copy->>repo: Copy mise.toml (if exists & !exists in dest)
copy->>repo: Copy mise.local.toml (if exists & !exists in dest)
end
cmd_create->>hook: Execute .worktreerc post_create()
hook->>repo: Run post-creation tasks
cmd_create->>deps: Auto-install dependencies
deps->>repo: Install tools based on copied mise configs
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Code Review
This pull request implements mise configuration inheritance when creating new worktrees. It ensures that mise.toml and mise.local.toml files are copied from the source to the new worktree, allowing tool version pinning to persist even for gitignored files. Documentation and tests for both single-repo and multi-repo setups have been updated accordingly. Feedback was provided regarding the error handling of the file copy operation in lib/common.sh to ensure logs accurately reflect whether the copy succeeded.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
test/single_repo.bats (1)
114-117: コピーであることも検証してください。
[ -f ]とdiffは symlink を追跡するため、実体コピーではなく symlink でもこのテストは通ります。copy_mise_configsの仕様を守るなら-Lで symlink でないことも確認してください。修正案
[ -f "${WORKTREES_DIR}/mise-task/mise.toml" ] [ -f "${WORKTREES_DIR}/mise-task/mise.local.toml" ] + [ ! -L "${WORKTREES_DIR}/mise-task/mise.toml" ] + [ ! -L "${WORKTREES_DIR}/mise-task/mise.local.toml" ] diff "${SINGLE_REPO_DIR}/mise.toml" "${WORKTREES_DIR}/mise-task/mise.toml" diff "${SINGLE_REPO_DIR}/mise.local.toml" "${WORKTREES_DIR}/mise-task/mise.local.toml"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/single_repo.bats` around lines 114 - 117, テストがシンボリックリンクでも通ってしまうため、single_repo.bats の該当アサーションを強化して copy_mise_configs が実体コピーを作っていることを確認してください。具体的には既存の [ -f "${WORKTREES_DIR}/mise-task/mise.toml" ] と diff コマンドに加えて [ ! -L "${WORKTREES_DIR}/mise-task/mise.toml" ] と [ ! -L "${WORKTREES_DIR}/mise-task/mise.local.toml" ] のチェックを追加し、両ファイルがシンボリックリンクでないことを検証してください(対象を見つける目印は copy_mise_configs と該当のファイルパス)。
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CLAUDE.md`:
- Around line 37-41: Replace English words used inside normal sentences with
Japanese equivalents in CLAUDE.md: change instances of "tracked" and "skip" to
appropriate Japanese terms (e.g., "追跡済み" and "スキップ" or better Japanese phrasing)
and ensure the whole paragraph for `worktree create` and the bullet points use
Japanese-only wording while keeping references to filenames (`mise.toml` /
`mise.local.toml`) and command `worktree create` unchanged; preserve the meaning
about copying files, the single-repo vs multi-repo rules, and the skip behavior
when files already exist in the worktree.
In `@lib/common.sh`:
- Around line 115-118: The current block calls cp "$src_file" "$dst_file" then
unconditionally logs via log_info " ${name} -> copied (from ${src_file})" even
if cp failed; change the flow in the snippet that references "$src_file",
"$dst_file", and log_info so that you check cp's exit status (e.g., run cp and
test its return or use if cp ...; then ...) and only call log_info on success,
and on failure return a non‑zero status (propagate the error) so the caller sees
the failure and can handle it.
---
Nitpick comments:
In `@test/single_repo.bats`:
- Around line 114-117: テストがシンボリックリンクでも通ってしまうため、single_repo.bats の該当アサーションを強化して
copy_mise_configs が実体コピーを作っていることを確認してください。具体的には既存の [ -f
"${WORKTREES_DIR}/mise-task/mise.toml" ] と diff コマンドに加えて [ ! -L
"${WORKTREES_DIR}/mise-task/mise.toml" ] と [ ! -L
"${WORKTREES_DIR}/mise-task/mise.local.toml" ]
のチェックを追加し、両ファイルがシンボリックリンクでないことを検証してください(対象を見つける目印は copy_mise_configs
と該当のファイルパス)。
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bbc11be8-367c-406b-a6fe-7e6fa82c358c
📒 Files selected for processing (7)
CLAUDE.mdREADME.mdlib/cmd_create.shlib/common.shskills/worktree-create/SKILL.mdtest/multi_repo.batstest/single_repo.bats
Check the exit status of `cp` and emit a `log_warn` on failure so the log no longer claims "copied" when the destination could not be written (e.g. permission error, disk full). Matches the `(continuing)` warning style already used for `git fetch` and dependency install steps. Co-Authored-By: Claude <noreply@anthropic.com>
Summary
mise.toml/mise.local.tomlfrom the source project into each new worktree duringworktree createmise.tomlalready checked out bygit worktree add(skips copy when destination exists)Motivation
mise-managed tool versions (PHP, Node.js, .NET, ...) did not follow new worktrees when the config was gitignored —
mise.local.tomlin particular is conventionally local-only, andgit worktree addonly checks out tracked files. As a result, worktrees fell back to global/system versions and subsequentnpm install/composer install/dotnet restorecould run under the wrong toolchain.Changes
lib/common.sh: addcopy_mise_configshelper (iterates overmise.toml,mise.local.toml, skips if destination exists)lib/cmd_create.sh: invoke the helper for each created worktree before the.worktreerchooktest/single_repo.bats: verify untrackedmise.tomlandmise.local.tomlare copiedtest/multi_repo.bats: verify untrackedmise.local.tomlis copied per sub-repo (usesmise.local.tomlonly since some upstream sub-repos already trackmise.toml)README.md/CLAUDE.md/skills/worktree-create/SKILL.md: document the new stepTest plan
./test/bats/bin/bats test/*.bats— 27/27 passingmise.toml+mise.local.tomlcopied with matching contentmise.local.tomlcopied into each sub-repo worktreemise.tomlprovided bygit worktree addis preserved (copy skipped)Refs: #12
🤖 Generated with Claude Code
Summary by CodeRabbit
リリースノート
新機能
ドキュメント
テスト