yeet

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Prerequisites

前提条件

  • Require GitHub CLI
    gh
    . Check
    gh --version
    . If missing, ask the user to install
    gh
    and stop.
  • Require authenticated
    gh
    session. Run
    gh auth status
    . If not authenticated, ask the user to run
    gh auth login
    (and re-run
    gh auth status
    ) before continuing.
  • 需要安装GitHub CLI
    gh
    。执行
    gh --version
    检查是否已安装。如果未安装,请让用户安装
    gh
    并终止操作。
  • 需要已通过身份验证的
    gh
    会话。执行
    gh auth status
    检查。如果未通过身份验证,请让用户先执行
    gh auth login
    (并重新运行
    gh auth status
    ),然后再继续。

Naming conventions

命名规范

  • Branch:
    codex/{description}
    when starting from main/master/default.
  • Commit:
    {description}
    (terse).
  • PR title:
    [codex] {description}
    summarizing the full diff.
  • 分支:从main/master/default分支开始时,命名为
    codex/{description}
  • 提交信息:
    {description}
    (简洁表述)。
  • PR标题:
    [codex] {description}
    ,需概括完整的代码变更内容。

Workflow

工作流程

  • If on main/master/default, create a branch:
    git checkout -b "codex/{description}"
  • Otherwise stay on the current branch.
  • Confirm status, then stage everything:
    git status -sb
    then
    git add -A
    .
  • Commit tersely with the description:
    git commit -m "{description}"
  • Run checks if not already. If checks fail due to missing deps/tools, install dependencies and rerun once.
  • Push with tracking:
    git push -u origin $(git branch --show-current)
  • If git push fails due to workflow auth errors, pull from master and retry the push.
  • Open a PR and edit title/body to reflect the description and the deltas:
    GH_PROMPT_DISABLED=1 GIT_TERMINAL_PROMPT=0 gh pr create --draft --fill --head $(git branch --show-current)
  • Write the PR description to a temp file with real newlines (e.g. pr-body.md ... EOF) and run pr-body.md to avoid \n-escaped markdown.
  • PR description (markdown) must be detailed prose covering the issue, the cause and effect on users, the root cause, the fix, and any tests or checks used to validate.
  • 如果当前处于main/master/default分支,请创建新分支:
    git checkout -b "codex/{description}"
  • 否则保留在当前分支。
  • 确认状态,然后暂存所有文件:先执行
    git status -sb
    ,再执行
    git add -A
  • 使用简洁描述提交:
    git commit -m "{description}"
  • 如果尚未运行检查,则执行检查。如果因缺少依赖/工具导致检查失败,请安装依赖并重试一次。
  • 推送并设置跟踪:
    git push -u origin $(git branch --show-current)
  • 如果因工作流身份验证错误导致git推送失败,请从master分支拉取代码并重试推送。
  • 打开PR并编辑标题/正文以体现描述和代码变更:
    GH_PROMPT_DISABLED=1 GIT_TERMINAL_PROMPT=0 gh pr create --draft --fill --head $(git branch --show-current)
  • 将PR描述写入临时文件并保留真实换行(例如pr-body.md ... EOF),通过运行pr-body.md来避免使用\n转义的Markdown格式。
  • PR描述(Markdown格式)必须包含详细内容,涵盖问题、对用户的影响、根本原因、修复方案,以及用于验证的任何测试或检查。