-
Notifications
You must be signed in to change notification settings - Fork 584
Comments
chore(scripts): Add git worktree management tools#5497
chore(scripts): Add git worktree management tools #5497ericapisani wants to merge 1 commit intomaster from
Conversation
Add helper scripts and make targets to simplify creating and managing git worktrees. The worktree-create script automates branch creation and virtual environment setup (preferring uv if available). The worktree-delete script removes worktrees and offers to clean up associated branches. Worktrees are particularly useful when working on multiple features independently of each other without needing to switch branches. This also enables parallelizing Claude Code sessions if desired, reducing friction when managing multiple development contexts. Co-Authored-By: Claude <noreply@anthropic.com>
Semver Impact of This PR
🟢 Patch (bug fixes)
📋 Changelog Preview
This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).
Bug Fixes 🐛
- (anthropic) Fix token accounting by shellmayr in
#5490
Documentation 📚
- New integration guide by alexander-alderman-webb in
#5476
Internal Changes 🔧
- (agents) Add sentry skills to be used by warden in CI reviews by ericapisani in
#5485 - (ai) Add configuration for dotagents by ericapisani in
#5480 - (github) Add warden configuration by ericapisani in
#5484 - (openai-agents) Expect new tool fields by alexander-alderman-webb in
#5471 - (repo) Add .serena to .gitignore by ericapisani in
#5464
- (scripts) Add git worktree management tools by ericapisani in
#5497
- 🤖 Update test matrix with new releases (02/19) by github-actions in
#5483 - 🤖 Update test matrix with new releases (02/18) by github-actions in
#5475
🤖 This preview updates automatically when you update the PR.
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.
Path traversal allows worktree creation outside intended directory
The Makefile regex validation ^[a-zA-Z0-9_/-]+The Makefile regex validation permits forward slashes in the NAME parameter. This allows path traversal sequences like ../../footo create worktrees outside the intended.worktrees` directory. An attacker with access to the Makefile target could create worktrees in arbitrary locations within the filesystem (relative to repo root), potentially overwriting or polluting other directories.
Suggested fix: Add validation in the script to reject names containing path traversal patterns, or modify the Makefile regex to disallow forward slashes.
Also found at 1 additional location
scripts/worktree-delete.sh:13-13
Identified by Warden [find-bugs] · QA3-AZZ
Codecov Results 📊✅ 13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 6.31s All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 13701 uncovered lines. Files with missing lines (180)
Generated by Codecov Action |
Add helper scripts and make targets to simplify creating and managing git worktrees. The worktree-create script automates branch creation and virtual environment setup (preferring uv if available). The worktree-delete script removes worktrees and offers to clean up associated branches.
Worktrees are particularly useful when working on multiple features independently of each other without needing to switch branches. This also enables parallelizing Claude Code sessions if desired, reducing friction when managing multiple development contexts.