Feature: Apply sparse-checkout at session worktree creation to avoid full-checkout timeouts on large repos
- 主要言語
- Shell
- スター
- 11.2k
- フォーク
- 1.9k
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 6
説明
### Describe the feature or problem you'd like to solve
Apply sparse-checkout at session worktree creation to avoid full-checkout timeouts on large repos
### Proposed solution
## Summary
When the app creates a new project session, it runs `git worktree add`, which
checks out the **entire** working tree. For very large monorepos this checkout
is slow enough to **time out**, so sessions fail to start.
New worktrees do **not** inherit sparse-checkout config from the main repo, and
hooks (e.g. `PreToolUse`) only fire *after* the worktree exists — so there is
currently no way to avoid the full checkout from the user side.
## Problem
- Repo: very large local repo (working tree in the multi-GB / high-file-count range)
- `git worktree add ` materializes the full tree
- Worktree creation times out → session cannot be created
- No pre-worktree hook / config exists to scope the checkout
## Proposal
Add a config option to scope the checkout when creating session worktrees, e.g.:
```jsonc
// settings.json
{
"session": {
"worktree": {
"sparseCheckout": {
"enabled": true,
"cone": true,
"paths": ["src/app", "libs/shared"]
}
}
}
}
```
### Example prompts or workflows
_No response_
### Additional context
Prior art / related
#2399 — sparse-checkout for plugin installs
#2463 — sparse-checkout for marketplace clones
Both apply sparse-checkout to reduce clone cost, but only for plugins/marketplace,
not for session worktrees. This request covers the session-creation path.
Environment
Copilot CLI version: 1.0.71-2
OS: Windows
Repo: local-only, very large working tree
コントリビューションガイド
調査の方向性
セッション worktree の作成パスと `git worktree add` の呼び出しから始め、その後、checkout 前に設定を適用する方法を確認します。大規模なリポジトリがツリー全体をマテリアライズしてタイムアウトすることなく、セッション worktree で提案された sparse-checkout 設定を使用できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- git
- 領域
- cli
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100