github / github/copilot-cli

Feature: Apply sparse-checkout at session worktree creation to avoid full-checkout timeouts on large repos

Đang mở
#4,145 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:configuration area:sessions
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

### 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu từ đường dẫn tạo session worktree và lệnh gọi `git worktree add`, sau đó xác định cách áp dụng cấu hình trước khi checkout. Hoàn thành khi một session worktree có thể sử dụng các thiết lập sparse-checkout được đề xuất, để các repository lớn không phải materialize toàn bộ cây và tránh bị timeout.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
git
Lĩnh vực
cli
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.