codex-pr-body

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Determining the PR(s)

确定要更新的PR

When this skill is invoked, the PR(s) to update may be specified explicitly, but in the common case, the PR(s) to update will be inferred from the branch / commit that the user is currently working on. For ordinary Git usage (i.e., not Sapling as discussed below), you may have to use a combination of
git branch
and
gh pr view <branch> --repo openai/codex --json number --jq '.number'
to determine the PR associated with the current branch / commit.
当调用此技能时,可以明确指定要更新的PR,但通常情况下,会从用户当前正在处理的分支/提交中推断出要更新的PR。对于普通Git使用场景(即下文讨论的Sapling除外),你可能需要结合使用
git branch
gh pr view <branch> --repo openai/codex --json number --jq '.number'
命令来确定与当前分支/提交关联的PR。

PR Body Contents

PR正文内容

When invoked, use
gh
to edit the pull request body and title to reflect the contents of the specified PR. Make sure to check the existing pull request body to see if there is key information that should be preserved. For example, NEVER remove an image in the existing pull request body, as the author may have no way to recover it if you remove it.
It is critically important to explain why the change is being made. If the current conversation in which this skill is invoked has discussed the motivation, be sure to capture this in the pull request body.
The body should also explain what changed, but this should appear after the why.
Limit discussion to the net change of the commit. It is generally frowned upon to discuss changes that were attempted but later undone in the course of the development of the pull request. When rewriting the pull request body, you may need to eliminate details such as these when they are no longer appropriate / of interest to future readers.
Avoid references to absolute paths on my local disk. When talking about a path that is within the repository, simply use the repo-relative path.
It is generally helpful to discuss how the change was verified. That said, it is unnecessary to mention things that CI checks automatically, e.g., do not include "ran
just fmt
" as part of the test plan. Though identifying the new tests that were purposely introduced to verify the new behavior introduced by the pull request is often appropriate.
Make use of Markdown to format the pull request professionally. Ensure "code things" appear in single backticks when referenced inline. Fenced code blocks are useful when referencing code or showing a shell transcript. Also, make use of GitHub permalinks when citing existing pieces of code that are relevant to the change.
Make sure to reference any relevant pull requests or issues, though there should be no need to reference the pull request in its own PR body.
If there is documentation that should be updated on https://developers.openai.com/codex as a result of this change, please note that in a separate section near the end of the pull request. Omit this section if there is no documentation that needs to be updated.
调用技能时,使用
gh
工具编辑拉取请求的正文和标题,使其与指定PR的内容相符。务必检查现有PR正文,确认是否有需要保留的关键信息。例如,绝对不要删除现有PR正文中的图片,因为作者可能无法恢复被删除的图片。
解释为什么要进行此更改至关重要。如果调用此技能的当前对话中已经讨论过更改动机,请务必将其纳入PR正文。
正文还应说明更改了什么,但这部分内容应放在原因之后。
讨论内容应仅限于提交的净变更。通常不建议讨论在PR开发过程中尝试过但后来撤销的更改。重写PR正文时,如果这些细节对未来读者不再合适或无意义,你可能需要删除它们。
避免提及本地磁盘上的绝对路径。当讨论仓库内的路径时,只需使用相对于仓库的路径即可。
讨论更改的验证方式通常很有帮助。但无需提及CI会自动检查的内容,例如,不要将"执行了
just fmt
"作为测试计划的一部分。不过,指出为验证PR引入的新行为而特意添加的新测试通常是合适的。
使用Markdown来格式化PR,使其更专业。内联引用代码相关内容时,确保使用反引号包裹。引用代码或展示shell脚本输出时,使用围栏代码块。此外,引用与更改相关的现有代码时,使用GitHub永久链接。
确保引用所有相关的PR或问题,但无需在PR正文中引用自身。

Working with Stacks

处理堆叠PR

Sometimes a pull request is composed of a stack of commits that build on one another. In these cases, the PR body should reflect the net change introduced by the stack as a whole, rather than the individual commits that make up the stack.
Similarly, sometimes a user may be using a tool like Sapling to leverage stacked pull requests, in which case the
base
of the PR may be the a branch that is the
head
of another PR in the stack rather than
main
. In this case, be sure to discuss only the net change between the
base
and
head
of the PR that is being opened against that stacked base, rather than the changes relative to
main
.
有时,一个PR由一系列相互依赖的提交组成。在这种情况下,PR正文应反映整个提交栈带来的净变更,而非构成栈的单个提交。
同样,有时用户可能会使用Sapling这类工具来创建堆叠拉取请求,此时PR的
base
可能是栈中另一个PR的
head
分支,而非
main
分支。在这种情况下,请务必仅讨论相对于该堆叠base分支的PR的
base
head
之间的净变更,而非相对于
main
分支的变更。

Sapling

Sapling

If
.git/sl/store
is present, then this Git repository is governed by Sapling SCM (https://sapling-scm.com).
In Sapling, run the following to see if there is a GitHub pull request associated with the current revision:
shell
sl log --template '{github_pull_request_url}' -r .
Alternatively, you can run
sl sl
to see the current development branch and whether there is a GitHub pull request associated with the current commit. For example, if the output were:
  @  cb032b31cf  72 minutes ago  mbolin  #11412
╭─╯  tui: show non-file layer content in /debug-config
o  fdd0cd1de9  Today at 20:09  origin/main
~
  • @
    indicates the current commit is
    cb032b31cf
  • it is a development branch containing a single commit branched off of
    origin/main
  • it is associated with GitHub pull request #11412
如果存在
.git/sl/store
,则此Git仓库由Sapling SCM(https://sapling-scm.com)管理。
在Sapling中,运行以下命令查看当前修订版本是否关联了GitHub PR:
shell
sl log --template '{github_pull_request_url}' -r .
或者,你可以运行
sl sl
命令查看当前开发分支以及当前提交是否关联了GitHub PR。例如,如果输出如下:
  @  cb032b31cf  72 minutes ago  mbolin  #11412
╭─╯  tui: show non-file layer content in /debug-config
o  fdd0cd1de9  Today at 20:09  origin/main
~
  • @
    表示当前提交为
    cb032b31cf
  • 这是一个基于
    origin/main
    分支创建的仅包含单个提交的开发分支
  • 它关联了GitHub拉取请求#11412