Files
zed/crates/git
Kirill Bulatov f693ad0847 Group Delta checkouts with their source repository (#67187)
Delta gives every checkout its own Git clone, so that each checkout has
its own refs, and lets the clone borrow objects from the source
repository through `objects/info/alternates`.
Zed groups workspaces by the common directory of their repository, so
each Delta checkout was a project of its own, and all of them had the
same name:



https://github.com/user-attachments/assets/ec8c4d62-7ba4-4356-b214-7b2a038869cc


Open Recent and the agents sidebar then listed one indistinguishable
entry per checkout, the title bar named every checkout `main`, and its
worktree picker listed the clone's Git directory as a worktree.

This change treats a Delta checkout like a linked worktree of its source
repository, as Max and Nathan suggested: the project appears once, and
each checkout is a worktree of it.



https://github.com/user-attachments/assets/97fe63b1-67ca-47b8-b965-c05cd703ffb8


Now:

- A Delta checkout joins the project group of its source repository in
the agents sidebar, in Open Recent and in the title bar.
- Thread rows, the project menus and the title bar label a checkout
after its Delta namespace directory.
- The title-bar worktree picker lists the other open checkouts of the
project, and no longer lists the Git directory of a clone as a worktree.
- The project picker of an archived thread lists every open checkout of
the project.
- Git operations keep using the checkout's own repository: grouping
identity and Git identity are separate values.
- A checkout is recognized only when its clone contains
`delta/copy-baseline` and the first line of its alternates file names
the objects directory of the source.


Notes on the implementation:

Before this change the identity of a project was the identity of its
repository in every layer.
A Delta checkout needs two identities, one for grouping and one for Git,
and every layer that stores, compares or shows the identity has to tell
them apart.

- Test are 3,772 of 6,206 added lines (most of the test size is
fixtures)
- The identity is persisted in three places (workspaces, threads,
terminals), and each needs to read rows saved by older builds.
- Left out on purpose, to keep it from being larger: conversion of saved
data that is not open, remote projects, and any new UI for closed
checkouts.

Release Notes:

- Improved the agents sidebar, Open Recent and the title bar to show
Delta checkouts as worktrees of their source project
2026-11-19 17:29:39 +00:00
..