Choose a specific organization-owned fork as the pull request head
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
调研方向
The change involves the gh pr create command. Start by examining the command's argument parsing and the logic for resolving the head repository in the codebase, likely in the pkg/cmd/pr/create directory. Look for existing handling of the --head flag and how it interacts with forks. The feature requires understanding GitHub's API for creating pull requests and how to specify a repository-qualified head. Testing will involve verifying the new syntax works correctly and that the --web flag error is properly implemented.
由索引模型根据 Issue 内容生成。
描述
Describe the feature or problem you’d like to solve
An organization can own more than one fork that could supply a pull request branch. An organization and branch alone are therefore not always enough to identify the contributor’s intended head repository.
As a contributor working in an organization with multiple forks, I want to identify the exact head repository, so that the pull request is created from the fork I intended.
Proposed solution
Allow gh pr create --head ORGANIZATION/REPOSITORY:BRANCH to identify the exact organization-owned head repository.
Feature: Choose a specific organization-owned fork as the pull request head
Scenario: The selected fork belongs to another organization
Given the base repository is "org/upstream"
And "other-org/upstream-fork" is a fork of the base repository
When the contributor runs `gh pr create --head other-org/upstream-fork:feature-branch`
Then a pull request is created from "other-org/upstream-fork:feature-branch"
And the pull request targets "org/upstream"
Scenario: The selected fork belongs to the same organization as the base repository
Given the base repository is "org/upstream"
And "org/upstream-fork" is a fork of the base repository
When the contributor runs `gh pr create --head org/upstream-fork:feature-branch`
Then a pull request is created from "org/upstream-fork:feature-branch"
And the pull request targets "org/upstream"
Scenario: The organization owns multiple candidate forks
Given the base repository is "org/upstream"
And "org/upstream-fork" is a fork of the base repository
And "org/experimental-upstream-fork" is a fork of the base repository
When the contributor runs `gh pr create --head org/upstream-fork:feature-branch`
Then a pull request is created from "org/upstream-fork:feature-branch"
And the pull request targets "org/upstream"
Scenario: Repository-qualified head is combined with web mode
When the contributor runs `gh pr create --head other-org/upstream-fork:feature-branch --web`
Then the command fails before opening a browser
And the error explains that a repository-qualified `--head` cannot be used with `--web`
And the error tells the contributor to omit `--web` or select the fork on GitHub
Additional context
This is a sub-issue of #10093.
This issue introduces the repository-qualified ORGANIZATION/REPOSITORY:BRANCH form. The --web behavior may be refined if GitHub’s web pull-request flow can identify the exact head repository.
- 主要语言
- Go
- 星标
- 46.3k
- 派生
- 9.1k
- 平均合并
- 1 天 7 小时
- 30 天内合并 PR
- 76
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cli/cli 的其他 Issue
-
enhancement
难度 1/5 1 小时以内 新手友好度 92/100
-
more-info-needed needs-triage
难度 1/5 1 小时以内 新手友好度 78/100
-
bug gh-pr priority-2
难度 2/5 1-3 小时 新手友好度 84/100
-
bug gh-pr priority-2
难度 2/5 1-3 小时 新手友好度 88/100
-
bug gh-auth priority-3
难度 2/5 1-3 小时 新手友好度 78/100
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 65/100
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
santhosh-tekuri/jsonschema#276 ·