github / github/app

Warn when selected folder resolves to a parent Git repository root

未关闭
#719 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Requests and ideas
主要语言
没有语言数据
星标
2.1k
派生
153
PR 合并指标
30 天内没有已合并 PR

描述

### Feature summary

Warn users when a selected subfolder resolves to an (accidentally) initialized parent Git repo, causing Copilot to open the parent directory instead.

### What problem are you trying to solve?

When a user selects an empty or new folder that lives inside an existing Git repository, Copilot opens the parent repository root instead of the selected folder. This follows normal Git behavior, since the selected folder inherits the nearest parent `.git` directory, but the UX is surprising when the user does not realize the parent directory is a repository.

Example:
- User selects: `~/personal-projects/new-empty-folder`
- Parent repo exists at: `~/personal-projects/.git`
- Copilot opens session at: `~/personal-projects`

This can look like Copilot ignored the user’s folder selection. Honestly, this problem really only occurs if the user _forgets_ that the parent directory (`personal-projects`) was originally set up as a git repository...

### Proposed solution

When the selected folder resolves to a parent Git repository root that is different from the selected path, Copilot should explicitly acknowledge this before creating the session.

Suggested message:
> The folder you selected is inside an existing Git repository:
>
> Selected folder: `~/personal-projects/new-empty-folder`
> Repository root: `~/personal-projects`
>
> Copilot sessions are created at the repository root, so this session will open `~/personal-projects` instead.

### Workflow impact

This is especially confusing for common personal dev workflows where users keep many unrelated projects under a container directory like `~/personal-projects`, `~/code`, or `~/src`. If that container directory was _accidentally_ initialized as a Git repo, every new empty child folder appears to Copilot as part of the parent repo.

### Installation context

_No response_

### Additional context

_No response_

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。