Configurable worktree include: bring git-ignored files in, carry untracked files back on merge
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- git, typescript
- 领域
- devtools
调研方向
Start by reading the existing SYMLINK_CANDIDATES handling and locating mergeTask() and worktree creation. The issue proposes enumerating ignored entries with git ls-files --others --ignored --exclude-standard --directory, but configuration storage, defaults, and carry-back conflicts are unresolved. Done means users can choose symlink or copy for selected entries and optionally carry new untracked files back on merge, with those policies decided.
由索引模型根据 Issue 内容生成。
描述
Background & motivation
A git worktree only contains tracked files, so ignored files never appear in a new worktree. Under AI-driven workflows this causes two pain points:
- Broken context: AI workflows often generate documents in the repo root (plans, design notes, context files). We usually don't want to commit them, so we ignore them via
.gitignore— but agents working inside a worktree need exactly those documents to keep context consistent. - Lost output: untracked files an agent newly creates inside a worktree (e.g.
docs/xxx.md) are permanently lost when the task is merged and the worktree is removed.
Today parallel-code works around this with a hardcoded allowlist (SYMLINK_CANDIDATES, only 8 entries such as .env and node_modules) that gets symlinked into each worktree. It cannot cover user-defined ignored files.
Proposal
Make worktree creation and merge behavior configurable per task:
- On task creation: let the user check which ignored files/directories to bring into the worktree (e.g.
.env,docs/), and choose how each entry is brought in:- Symlink: shared with the main checkout (good for large directories that don't need isolation, like
node_modules); - Copy: an independent copy inside the worktree (good for documents the agent may modify, like
.env).
- Symlink: shared with the main checkout (good for large directories that don't need isolation, like
- On task merge: optionally carry untracked files newly created inside the worktree (e.g.
docs/xxx.md) back into the project root, so output isn't lost when the worktree is removed.
Relationship to Claude Code's .worktreeinclude
Claude Code's .worktreeinclude solves a similar problem, but it only copies ignored files one way, at creation time; they are deleted together with the worktree on cleanup and never carried back to the main checkout. This proposal extends that idea with:
- a per-entry choice of symlink vs. copy (symlink avoids the copy cost of large directories like
node_modules; copy guarantees isolation); - carrying untracked files created in the worktree back to the project root on merge, preventing output loss.
Implementation sketch
- Enumeration:
git ls-files --others --ignored --exclude-standard --directory, collapsed to top-level entries of the repo root. A single command covers all ignore mechanisms (.gitignore, nested gitignores,.git/info/exclude, global excludesFile) — no need to parse gitignore syntax ourselves..worktrees/and.gitmust be force-excluded (to avoid linking the worktree directory into itself). - Creation: symlink or copy each checked entry according to its config.
- Merge: in
mergeTask(), beforeremoveWorktree, copy the entries marked as "carry back" from the worktree to the project root. - This feature can replace the existing hardcoded
SYMLINK_CANDIDATESallowlist.
Open questions
- Where should the configuration live: a
.worktreeinclude-style file inside the repo (shareable via git, compatible with Claude Code conventions) vs. an in-app per-project setting? - On carry-back in copy mode, if the same file was also modified in the main checkout, how should conflicts be handled (overwrite / skip with a warning / keep both)?
- Default selection policy (large ignored directories like
dist/should presumably not be copied by default?)
- 主要语言
- TypeScript
- 星标
- 1k
- 派生
- 144
- 平均合并
- 4 天 19 小时
- 30 天内合并 PR
- 28
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
johannesjo/parallel-code 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
johannesjo/parallel-code#385 ·
维护者通常 4 天内回复
-
Option to show usage as used instead of left, and potential further customization ideas可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
johannesjo/parallel-code#353 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
johannesjo/parallel-code#163 · 2 条评论 ·
维护者通常 4 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 12/100
johannesjo/parallel-code#375 · 2 条评论 ·
维护者通常 4 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 35/100
johannesjo/parallel-code#374 ·
维护者通常 4 天内回复
查看 johannesjo/parallel-code 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
ci
难度 2/5 1-3 小时 新手友好度 78/100
ClickHouse/clickhouse-js#1248 ·
维护者通常 1 天内回复
-
E2E: Darlehen-Test wartet auf die gebuchte Auszahlung, bevor er zur Liquiditätsvorschau wechselt未关闭technik
难度 2/5 1-3 小时 新手友好度 78/100
-
bug
难度 2/5 1-3 小时 新手友好度 67/100
SR5-FoundryVTT/SR5-FoundryVTT#2162 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 84/100
AhmedNAgy25/analysor#25 ·
维护者通常 1 天内回复