From 15a7fdb579f9ae139becb2eb8cc560f25847507b Mon Sep 17 00:00:00 2001 From: wyattb Date: Mon, 12 Oct 2026 15:40:21 -0400 Subject: [PATCH] Delphi 0.4.1: setup.sh also excludes what tools leave at the root (/.playwright-mcp/, /pictures/, .DS_Store) --- .delphi/manifest.yml | 2 +- .delphi/setup.sh | 5 +++-- .delphi/versions | 1 + docs/design.md | 3 ++- tests/e2e.sh | 7 ++++--- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.delphi/manifest.yml b/.delphi/manifest.yml index 5b26d6c..310902b 100644 --- a/.delphi/manifest.yml +++ b/.delphi/manifest.yml @@ -6,7 +6,7 @@ # MINOR something new that existing clones need nothing for # MAJOR clones need cleanup (MINOR while 0.x): add .delphi/migrations/-.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 diff --git a/.delphi/setup.sh b/.delphi/setup.sh index 704b122..d47c97b 100755 --- a/.delphi/setup.sh +++ b/.delphi/setup.sh @@ -8,7 +8,8 @@ # run, with pushes disabled. Each entry under `workspaces:` (`- ws/` 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/; 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/-*.sh this workspace hasn't (oldest first; the last one done @@ -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) diff --git a/.delphi/versions b/.delphi/versions index f046913..5d9765c 100644 --- a/.delphi/versions +++ b/.delphi/versions @@ -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 diff --git a/docs/design.md b/docs/design.md index f8a0d21..7c657bb 100644 --- a/docs/design.md +++ b/docs/design.md @@ -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/`, then checks out its default branch as the first worktree, `worktrees///` (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 `` (default: origin's `HEAD`) with `--depth 1` into `references//`, 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 diff --git a/tests/e2e.sh b/tests/e2e.sh index 70a8c8f..aafbbe9 100644 --- a/tests/e2e.sh +++ b/tests/e2e.sh @@ -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"