Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .delphi/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# MINOR something new that existing clones need nothing for
# MAJOR clones need cleanup (MINOR while 0.x): add .delphi/migrations/<version>-<slug>.sh, which
# setup.sh runs once per workspace in each clone (rules in Delphi's CLAUDE.md)
version: 0.4.0
version: 0.4.1
files: # repo-relative paths; a trailing / means everything under it
- .delphi/manifest.yml
- .delphi/.gitattributes
Expand Down
5 changes: 3 additions & 2 deletions .delphi/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
# run, with pushes disabled. Each entry under `workspaces:` (`- ws/<name>` or `- main`, a workspace
# being named by its place in the tree) gets the same kind of copy of that branch of this clone's
# origin (Delphi), at linked/<branch>; to edit one, switch this clone to it (.delphi/switch.sh). Adds /repos/, /worktrees/, /references/ and
# /linked/ to this clone's .git/info/exclude, and writes its post-checkout hook, which runs .delphi/park.sh (on
# /linked/ to this clone's .git/info/exclude, with what tools leave at the root (Playwright MCP's
# /.playwright-mcp/, screenshots in /pictures/, macOS's .DS_Store), and writes its post-checkout hook, which runs .delphi/park.sh (on
# every branch) as just checked out in the worktree that checked out (unless another hook is there), so switching
# to another workspace or main parks them. First
# it runs the .delphi/migrations/<version>-*.sh this workspace hasn't (oldest first; the last one done
Expand Down Expand Up @@ -103,7 +104,7 @@ EOF2

exclude=$(git rev-parse --git-path info/exclude)
mkdir -p "$(dirname "$exclude")"
for d in /repos/ /worktrees/ /references/ /linked/; do
for d in /repos/ /worktrees/ /references/ /linked/ /.playwright-mcp/ /pictures/ .DS_Store; do
grep -qxF "$d" "$exclude" 2>/dev/null || echo "$d" >>"$exclude"
done
hook=$(git rev-parse --git-path hooks/post-checkout)
Expand Down
1 change: 1 addition & 0 deletions .delphi/versions
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
0.2.0 311f7b23606c .delphi/paths.sh is the workspace layout (DELPHI_ROOT, DELPHI_WORKTREES, …): sourced, it exports it; run, it prints the export line a session hook puts in every shell
0.3.0 2c870f633c30 workspace-inherit/ folders at any level of software/ reach every workspace below on each sync (opt-out: in workspace.yml); defaults/ is workspace-defaults/
0.4.0 ba662e754219 setup.sh warns (.delphi/plugins.sh) about enabled plugins not installed here; CLAUDE.md says how to install them
0.4.1 c5e413632e1c setup.sh also excludes what tools leave at the root: /.playwright-mcp/, /pictures/ and .DS_Store
3 changes: 2 additions & 1 deletion docs/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ Nobody pushes to `ws/*` or `main` directly (branch protection; CI's token is the
First runs the workspace's pending migrations (section 5b). Then reads `repos:` from `workspace.yml` and, for each not yet present, fetches it into a bare store at
`repos/<name>`, then checks out its default branch as the first worktree,
`worktrees/<name>/<default-branch>/` (re-created if missing). Adds `/repos/` and `/worktrees/` to
the clone's `.git/info/exclude` once. For each repo under `references-git:` (read-only dependency
the clone's `.git/info/exclude` once, along with what tools leave at the root: `/.playwright-mcp/`,
`/pictures/` (screenshots) and `.DS_Store`. For each repo under `references-git:` (read-only dependency
sources), it fetches `<ref>` (default: origin's `HEAD`) with `--depth 1` into `references/<name>/`,
checks it out detached, disables pushes, and does this again on every run, so the copy tracks its pin;
a failed fetch is reported and the old copy kept. Adds `/references/` to the exclude too; references get
Expand Down
7 changes: 4 additions & 3 deletions tests/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,12 @@ for r in lib1 lib2; do
done
[ "$(git -C "$t/ws/repos/lib1" rev-parse --is-bare-repository)" = true ] || fail "repos/lib1 not a bare store"
grep -q "repos/lib1: already present" "$t/out" || fail "re-run did not skip"
for d in /repos/ /worktrees/; do [ "$(grep -cx "$d" "$t/ws/.git/info/exclude")" = 1 ] || fail "$d not excluded exactly once"; done
[ "$(git -C "$t/ws" status --porcelain)" = " M workspace.yml" ] || fail "repos/ or worktrees/ shows in status"
for d in /repos/ /worktrees/ /.playwright-mcp/ /pictures/ .DS_Store; do [ "$(grep -cx "$d" "$t/ws/.git/info/exclude")" = 1 ] || fail "$d not excluded exactly once"; done
mkdir -p "$t/ws/.playwright-mcp" "$t/ws/pictures/b" "$t/ws/docs" && touch "$t/ws/.playwright-mcp/p.yml" "$t/ws/pictures/b/s.png" "$t/ws/.DS_Store" "$t/ws/docs/.DS_Store"
[ "$(git -C "$t/ws" status --porcelain)" = " M workspace.yml" ] || fail "repos/, worktrees/ or a tool's files show in status: $(git -C "$t/ws" status --porcelain)"
rm -rf "$t/ws/worktrees/lib2" && git -C "$t/ws/repos/lib2" worktree prune && /bin/bash "$t/ws/.delphi/setup.sh" >/dev/null 2>&1 &&
[ -d "$t/ws/worktrees/lib2/$def" ] || fail "re-run did not restore a missing default worktree"
ok "setup.sh makes a bare store in repos/ plus a default-branch worktree in worktrees/, excludes both once, and is idempotent"
ok "setup.sh makes a bare store in repos/ plus a default-branch worktree in worktrees/, excludes both (and tools' files) once, and is idempotent"
w=$t/legacy && git clone -q -b ws/$AN "$t/origin.git" "$w" && cp "$t/ws/workspace.yml" "$w/" && git clone -q "$t/lib1.git" "$w/repos/lib1"
/bin/bash "$w/.delphi/setup.sh" >/dev/null 2>"$t/err" || fail "setup.sh failed on a pre-existing clone"
{ grep -q "could not check out worktrees/lib1/$def" "$t/err" && [ -d "$w/worktrees/lib2/$def" ]; } || fail "pre-existing clone not reported"
Expand Down
Loading