chore(devenv): add worktree bootstrap helper script#274
Conversation
Add a single-command setup helper for newly created git worktrees so developers can run devenv sync before invoking Makefile targets. Co-Authored-By: Codex <noreply@openai.com> Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Script enables direnv that warns against its own use case
- Modified setup-worktree.sh to skip 'direnv allow' when the directory basename doesn't match the expected repo name, preventing confusing warnings in worktrees.
Or push these changes by commenting:
@cursor push 03705e07ff
Preview (03705e07ff)
diff --git a/scripts/setup-worktree.sh b/scripts/setup-worktree.sh
--- a/scripts/setup-worktree.sh
+++ b/scripts/setup-worktree.sh
@@ -15,7 +15,10 @@
devenv sync
if command -v direnv >/dev/null 2>&1 && [ -f .envrc ]; then
- direnv allow "${repo_root}" >/dev/null 2>&1 || true
+ expected_repo_name="$(awk -F'[][.]' '/^\[venv\./{print $3; exit}' devenv/config.ini 2>/dev/null)"
+ if [ -z "$expected_repo_name" ] || [ "$(basename "${repo_root}")" = "$expected_repo_name" ]; then
+ direnv allow "${repo_root}" >/dev/null 2>&1 || true
+ fi
fi
echo "Worktree setup complete."You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 1a80630. Configure here.
| devenv sync | ||
|
|
||
| if command -v direnv >/dev/null 2>&1 && [ -f .envrc ]; then | ||
| direnv allow "${repo_root}" >/dev/null 2>&1 || true |
There was a problem hiding this comment.
Script enables direnv that warns against its own use case
Low Severity
The direnv allow on line 18 enables .envrc, which contains a basename guard that prints warnings and skips devenv sync when the directory name doesn't match the expected sentry-protos from devenv/config.ini. Since worktrees typically have different directory names, the script's target audience will see confusing messages like "Move this checkout to a path ending in '/sentry-protos'" on every shell prompt after running this helper — undermining the seamless bootstrap experience the script is meant to provide.
Reviewed by Cursor Bugbot for commit 1a80630. Configure here.



Add a dedicated helper script for newly created git worktrees.
Fresh worktrees often run
makebefore a local.venvexists, which leads to ambient interpreter usage.scripts/setup-worktree.shnow bootstraps the worktree by runningdevenv syncand, when available, allows direnv for the repository.README now documents this as the first step after creating a new worktree.
Made with Cursor