Skip to content

Commit 6586617

Browse files
committed
Add worktrees and Zed guides
1 parent 0bceaab commit 6586617

3 files changed

Lines changed: 121 additions & 3 deletions

File tree

src/routes/guides/warp/+page.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: Warp guide
3+
description: How to use Warp to for code reviews and agent orchestration.
4+
---
5+
6+
Test
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: Worktrees guide
3+
description: Manual Git worktree management.
4+
---
5+
6+
[Warp](/guides/warp) recognizes worktrees but does not support managing them. [Zed](/guides/zed)
7+
supports worktree management but does not allow you to co-locate worktrees with the main repository.
8+
9+
## Create a worktree
10+
11+
I want the worktree to be co-located with my cloned repository. If the cloned repository is
12+
`path/to/website`, the worktrees should reside in `path/to/website.worktrees`. This is a convention
13+
that VS Code's worktree implementation uses and that I like better than a central `worktrees`
14+
directory.
15+
16+
Suppose you need a worktree for issue 1234. Run:
17+
18+
```bash
19+
git worktree add -b i-1234 ../website.worktrees/w-1234
20+
```
21+
22+
to create branch `i-1234` in worktree `w-1234`.
23+
24+
Suppose you need a worktree to review pull request 1173, which uses branch `i-1172`. Run:
25+
26+
```bash
27+
git worktree add ../website.worktrees/r-1173 i-1172
28+
```
29+
30+
Using `r-1173` instead of `w-1173` as the worktree name makes it clear that this worktree is for
31+
code review.
32+
33+
## Worktree management
34+
35+
Run:
36+
37+
```bash
38+
git worktree list
39+
```
40+
41+
in the main repository or in any derived worktree to list all worktrees. The worktree location above
42+
is just a convention. Worktrees can be anywhere.
43+
44+
Run:
45+
46+
```bash
47+
git worktree remove ../website.worktrees/w-1234
48+
```
49+
50+
to remove a worktree.
51+
52+
Alternatively, Zed has great worktree management.

src/routes/guides/zed/+page.md

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,66 @@
11
---
2-
title: Zed
3-
description: My Zed editor setup.
2+
title: Zed guide
3+
description: How to use Zed for agentic coding.
44
---
55

6-
My Zed editor setup goes here.
6+
## Shortcuts
7+
8+
| Shortcut | Description |
9+
| :------- | :------------------ |
10+
| `⌘ B` | Toggle left dock. |
11+
| `⌘ R` | Toggle right dock. |
12+
| `⌘ ⇧ E` | Show project panel. |
13+
| `⌘ ⇧ G` | Show Git panel. |
14+
| `⌘ ⇧ B` | Show outline panel. |
15+
| `⌘ ?` | Show agent panel. |
16+
| `⌃ ⇧ R` | Review changes. |
17+
| `@` | Add to context. |
18+
19+
## Worktrees
20+
21+
Workspace isolation is done with Git [worktrees](/guides/worktrees). You can manage worktrees with
22+
`git: worktree`. This works well except for the creation of new worktrees. Zed thinks that all
23+
worktrees it creates should be located in one central (but customizable) directory. And it does not
24+
support creating worktrees from existing branches.
25+
26+
## Orchestration
27+
28+
Use one worktree per window. The UI is not designed to run multiple agents in parallel. You can do
29+
this with one window per agent, but there is no good way to manage all the running agents.
30+
31+
## Code reviews
32+
33+
### Review files changed by agent
34+
35+
You can look at uncommitted changes with `git: diff`. You can stage or restore changes one by one,
36+
but that is usually not what you want. When there are uncommitted changes made by an agent, you will
37+
see the **Review changes** button. Alternatively, you can use the keyboard shortcut to open this
38+
view. In this view, you can accept or reject the agent's changes one by one.
39+
40+
When you do this is up to you. You might do a few iterations with the agent without looking at the
41+
code and then review, or you might review changes in every iteration. You can also copy all the
42+
diffs and add them to your agent's context, or rather another agent's context, and let the agent do
43+
a code review.
44+
45+
### Pull request review
46+
47+
One downside of Zed is that it does not yet have anything that matches
48+
[GitHub's pull requests extension](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github).
49+
You have to find a different workflow to do pull requests.
50+
51+
Since you can't create a worktree from the pull request branch in Zed, you need to create a worktree
52+
for the review manually. With `git: branch diff`, you can create a diff between the default branch
53+
on origin and the branch you are on. It is currently not possible to diff against another branch,
54+
for example when you stack pull requests.
55+
56+
You can create a diff and send it to your current agent for a first review.
57+
58+
Two more useful features for exploring the pull request are the Git graph and the file history,
59+
which you can access for each file with a right-click.
60+
61+
A big downside is that you cannot write line comments during a pull request review in Zed. You need
62+
to switch context to the Git provider's website.
63+
64+
## Resolve merge conflicts
65+
66+
Zed has built-in merge conflict resolution (not tested yet).

0 commit comments

Comments
 (0)