github / github/copilot-cli

`/diff` branch mode: allow selecting the base branch

未关闭
#3,903 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:tools
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the feature or problem you'd like to solve

When using  `/diff`  in branch mode, the base branch is auto-detected as the default branch of the tracking remote (e.g.,  `origin/main` ). There's no way to override this - if your branch was cut from something other than the default branch, the diff includes noise from the parent branch rather than just your changes.

### Proposed solution

Allow specifying a base branch when using branch diff mode - e.g., a text input when selecting "Branch diff", or a parameter like  `/diff base=feature/xyz` . This would let users diff against any branch, not just the remote default.

### Example prompts or workflows

- Working on a branch cut from `feature/parent` - want to see only changes since that branch, not since `main`
- Comparing work against a release branch rather than the repo default

### Additional context

_No response_

贡献指南

打开贡献指南

调研方向

从 `/diff` 命令的分支模式入口开始,跟踪它如何选择跟踪远程仓库的默认分支。添加一种提供备用基分支的方式,然后验证分支 diff 是针对所选分支进行比较的,并排除从父分支继承的更改。

由索引模型根据 Issue 内容生成。

评估

技术栈
git
领域
cli
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
64/100

把新 issue 发到你的邮箱

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