Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ pull requests.

You'll need a local clone of this repository to start.

### New worktrees

For a newly created git worktree, bootstrap the local environment before running `make`:

```shell
./scripts/setup-worktree.sh
```

This runs `devenv sync` for the worktree and (when installed) enables direnv for the repo.

### Python

From the root of `sentry-protos` run:
Expand Down
21 changes: 21 additions & 0 deletions scripts/setup-worktree.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -euo pipefail

if ! command -v devenv >/dev/null 2>&1; then
echo "devenv is required to bootstrap this worktree." >&2
echo "Install instructions: https://github.com/getsentry/devenv#install" >&2
exit 1
fi

repo_root="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
cd "${repo_root}"

echo "Bootstrapping sentry-protos worktree at ${repo_root}"
devenv sync

if command -v direnv >/dev/null 2>&1 && [ -f .envrc ]; then
direnv allow "${repo_root}" >/dev/null 2>&1 || true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1a80630. Configure here.

fi

echo "Worktree setup complete."
Loading