Skip to content

upgrade worktree script#2237

Merged
simo6529 merged 1 commit intomainfrom
upgrade-worktree-script-to-respect-6529-namespace
Apr 9, 2026
Merged

upgrade worktree script#2237
simo6529 merged 1 commit intomainfrom
upgrade-worktree-script-to-respect-6529-namespace

Conversation

@simo6529
Copy link
Copy Markdown
Collaborator

@simo6529 simo6529 commented Apr 9, 2026

Summary by CodeRabbit

  • Chores
    • Improved development environment setup with automatic shell detection (zsh/bash)
    • Updated bootstrap workflow for faster configuration initialization
    • Added guidance for applying environment changes to the current shell session

Signed-off-by: Simo <simo@6529.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 9, 2026

📝 Walkthrough

Walkthrough

The wt-add.sh script has been refactored to improve shell compatibility and streamline worktree initialization. The update adds bash compatibility checks, shell detection logic to identify the user's default shell (zsh or bash), PATH cleanup for repo-specific wrappers, and replaces the previous VS Code and pre-commit setup with a new "6529 bootstrap" flow.

Changes

Cohort / File(s) Summary
Worktree Setup Script
scripts/worktree/wt-add.sh
Added bash shebang with re-exec bootstrap, user shell detection (zsh/bashrc), new strip_repo_bin_wrappers_from_path() function to clean PATH, replaced VS Code/pre-commit setup with ./bin/6529 bootstrap flow, and added user instructions for sourcing shell rc files or bootstrap exports.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~35 minutes

Possibly related PRs

  • #1737: Also modifies scripts/worktree/wt-add.sh with changes to worktree path handling, shell configuration, and bootstrap/install procedures.

Suggested reviewers

  • ragnep

Poem

🐰 A bootstrap wish upon the wind,
Where shells and paths align,
The worktree sprouts with care,
No more setup despair,
Just 6529 magic—so fine!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'upgrade worktree script' is vague and generic, lacking specific details about what aspects of the script were upgraded or why. Consider a more descriptive title such as 'Add bootstrap flow and path wrapper cleanup to worktree setup script' to clarify the main improvements.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch upgrade-worktree-script-to-respect-6529-namespace

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 9, 2026

Quality Gate Passed Quality Gate passed

Issues
0 New issues
2 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/worktree/wt-add.sh`:
- Around line 34-41: The case block currently sets USER_RC_FILE to ~/.bashrc for
any shell other than zsh, which mislabels unsupported shells (e.g., fish);
update the switch on USER_SHELL so that zsh and bash are handled explicitly (set
USER_RC_FILE to ${HOME}/.zshrc and ${HOME}/.bashrc respectively) and add a
fallback branch (e.g., *) that prints a clear unsupported-shell error/usage
message and exits instead of defaulting to bash; apply the same change to the
other identical block around the activation instructions (the case handling at
lines you flagged) and ensure any generated activation instructions are only
produced for supported shells.
- Around line 47-52: The code uses unquoted word splitting via set --
$input_path which triggers glob expansion and SC2086; instead split PATH safely
without pathname expansion by replacing the set -- $input_path approach with a
read-based split (e.g., use read -r -a into an array from input_path while
preserving IFS) and then iterate over that array in the for loop (referencing
input_path, IFS, the current set -- usage and the for part in "$@" loop) so PATH
entries containing glob characters are not expanded.
🪄 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: 36a7e5aa-84d8-4437-8a75-dc4be6cae3be

📥 Commits

Reviewing files that changed from the base of the PR and between 7e7041d and ed5bf90.

📒 Files selected for processing (1)
  • scripts/worktree/wt-add.sh

Comment thread scripts/worktree/wt-add.sh
Comment thread scripts/worktree/wt-add.sh
@simo6529 simo6529 merged commit bfa1068 into main Apr 9, 2026
8 checks passed
@simo6529 simo6529 deleted the upgrade-worktree-script-to-respect-6529-namespace branch April 9, 2026 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants