Skip to content

fix: skip .docusaurus and .pnpm-store when comparing a finished worktree's ignored files - #6646

Merged
janicduplessis merged 2 commits into
mainfrom
fix/6643-regenerated-ignored-folders
Nov 28, 2026
Merged

janicduplessis merged 2 commits into
mainfrom
fix/6643-regenerated-ignored-folders

Conversation

@janicduplessis

@janicduplessis janicduplessis commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Description

A finished worktree stays while one of its git-ignored files is missing from the main checkout or differs there (ignoredFilesHold), except inside ignored directories named like build output (SKIPPED_WHERE_IGNORED). Docusaurus's generated .docusaurus/ folder and a project-local pnpm content store (.pnpm-store/) are not on that list, so a Docusaurus site, or a pnpm project whose store sits inside the checkout, kept its finished worktrees for good. Only the tool writes either folder, and running the tool again recreates it.

Solution

Add .docusaurus and .pnpm-store to SKIPPED_WHERE_IGNORED, matching .next and .turbo. The set has three users, and they stay consistent:

  • the removal hold for discovered and registered finished worktrees (discovered-removal.ts);
  • the source-activity scan, where writes inside these folders no longer count as activity;
  • savedWorktreeFacts in gc/worktrees.ts, which rechecks a saved worktree from saved facts only when its ignored entries are all skipped folders; a worktree with these folders no longer falls back to the full check.

As for the other names, a folder is skipped only where git ignores it. Folders that can hold local data or account links (.wrangler, .vercel, .supabase, .firebase) are left out on purpose. LLP 0004 names the two additions.

Still held, and out of scope: files stim worktree warm carries, such as AGENTS.override.md, and unrecognised binaries. Either may be someone's own work, so #6643 lists options for the maintainer.

Fixes #6643

Test plan

  • discovered-worktrees.test.ts: the case "skips ignored directories named like build output at any depth" now also writes website/.docusaurus/client-manifest.json. With the name removed from the set it fails with kept: its git-ignored file website/.docusaurus/....
  • Read-only, the branch's ignoredFilesHold run against four real finished worktrees of this repository, compared with main's list: the .pnpm-store worktree goes from "more than 200 git-ignored files to compare" to no hold. The two .docusaurus worktrees move on to a repository-specific generated file (website/docs/_generated/), so they stay held (see the issue comment). The stim-fsevents one is unchanged.

@janicduplessis janicduplessis added area: cli packages/stim-cli, including its README and guide area: docs docs/ and root documents labels Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli packages/stim-cli, including its README and guide area: docs docs/ and root documents review: ai-approved A fresh AI review found nothing left to fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gc keeps finished worktrees for regenerated ignored folders such as .docusaurus

1 participant