wt allowed a new worktree's .envrc only when it matched the primary
checkout's, and left it blocked otherwise. A branch based on an older
main has an older .envrc, so its worktree stayed blocked, `direnv exec`
failed, no .bsp/pants.json was written and Metals set up scala-cli
instead. The warning saying so scrolled away when a review started
Emacs.
It now compares with main's .envrc: the same content is allowed as
before, and different content is shown as a diff with a y/N prompt
before anything else runs. Comparing with main rather than the primary's
working copy also stops wt allowing content that was never approved in
the primary.
rv (alex/rv on gitea) watches GitHub for pull requests that request a
review from me or from soundtrackyourbrand/content, notifies on each,
and lists them in a web UI on 127.0.0.1:7778 that opens a review in its
own worktree with Emacs. programs.rv runs `rv serve` as a systemd user
service with the work GitHub token, on the same condition as the other
GitHub-backed work tools.
A worktree whose directory was deleted by hand stays registered in git,
so `wt sync` ran `gt restack` in a directory that no longer existed and
reported the worktree as failed. It now runs `git worktree prune` before
going through the worktrees, which drops only entries whose directory
is gone.
`.bsp/` is gitignored, so a worktree started without the Pants BSP
connection file. Metals then found no build server, ran `scala-cli
setup-ide` and compiled the whole repo as one Scala 3 project with no
third-party dependencies, so go to definition found nothing and
semanticdb never appeared.
When the primary checkout has `.bsp/pants.json`, `wt` now runs `pants
experimental-bsp` in each worktree it adds, in that worktree's devshell
and without starting a pantsd. The runner script it writes records the
devshell's PATH and the checkout's log path, so it is generated rather
than copied from the primary. When direnv cannot load, as when the
`.envrc` differs from the primary's, `wt` says what to run instead.
An unknown option such as `-b` or `--help` was taken as a branch name
and passed on to `git worktree add`, which read it as its own option:
`--help` printed git's usage and `-b` failed asking for a value. `wt`
now prints its own usage for `-h`/`--help`, moved there from the
comment at the top of the file, and rejects any other option.
In a worktree, `gt sync` deletes a merged current branch by first
switching to main, which git refuses while the primary has main checked
out. `wt sync` now runs `gt sync` in the primary, which leaves a merged
branch checked out in a worktree alone.
Worktrees whose PR is merged are no longer restacked. They stay until
removed with `wt rm`, so a session in one can still be resumed. The
merged PRs are read from gt's `.graphite_pr_info` cache, which `gt sync`
has just refreshed; gt has no command that lists them.
`gt sync` skips branches checked out in another worktree, so a stack
living in one stays on the old main. `wt sync` runs `gt sync`, then
`gt restack` in each worktree not on main. A conflict in one worktree
leaves it mid-rebase and does not stop the others; the failed
worktrees are listed at the end and the exit status is 1.
`wt <branch>` goes to the worktree holding a branch, creating one in
`<primary>.worktrees/<branch>` if needed; `wt -c` starts a new
Graphite-tracked branch off main in its own worktree; `wt rm` removes
one and keeps the branch.
A new worktree gets `direnv allow` only when its `.envrc` matches the
primary's. In backend it also gets a `.pants.rc` pinning `find_links`
to the primary's `dist/`: `pants.toml` sets it to the checkout's own
path, which put the path into every `requirements.pex` cache key and
made each worktree rebuild them. No lockfile resolves from it.
systemd-tmpfiles now ensures ~/code and ~/code/work are owned by
alex, since agenix previously created ~/code/work as root when the
work secrets pointed there directly.
Also drop the custom path= on work-gitconfig, work-github-token, and
work-go-private so they use agenix's default secret path instead of
living under ~/code/work.