sending-pull-request

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Send a pull request

提交拉取请求

When asked only to write or review a PR/MR title or body, inspect the supplied context, read BODY.md, and return the copy without changing the repository or forge. Read MEDIA.md when the body needs screenshots or video.
To send work for review:
  1. Fetch
    origin
    , resolve the current and default branches, and inspect commits and working-tree changes against
    origin/<default>
    . Stop if there is no work to send.
  2. Put the work on a conventional
    <type>/<short-kebab-description>
    branch without stashing or changing it:
    • Keep a conventional non-default branch.
    • On the default branch, choose the name from the work using its Conventional Commit type, then preserve every commit and working-tree change before resetting the local default branch:
      bash
      git switch --no-track -c <new-branch>
      git branch -f <default> origin/<default>
    • Rename a clearly auto-generated placeholder branch with
      git branch -m <new-branch>
      .
    • Stop on another non-conventional branch unless the user asked to rename it.
  3. Verify that the branch and work are unchanged. Stop if any intended change is uncommitted.
  4. Inspect the commits and diff against the default branch. Write a Conventional Commit title under 70 characters, read BODY.md, and write the body from what the diff cannot explain.
  5. Check for an open PR from the current branch. Push with tracking; use
    --force-with-lease
    only after an intentional history rewrite.
  6. Create the PR with
    --assignee @me
    , or update its title and body, using a temporary
    --body-file
    and deleting it afterward. A direct user invocation creates a ready PR; an autonomous invocation creates a draft unless the user requested otherwise.
  7. Return the PR URL.
当仅被要求撰写或审核PR/MR的标题或正文时,请检查提供的上下文,阅读BODY.md,并返回文案,无需修改仓库或代码托管平台。当正文需要截图或视频时,请阅读MEDIA.md
提交工作以供审核的步骤:
  1. 拉取
    origin
    代码,确定当前分支和默认分支,对比
    origin/<default>
    检查提交记录和工作区变更。如果没有可提交的工作,请停止操作。
  2. 将工作内容放到符合规范的
    <type>/<short-kebab-description>
    分支上,无需暂存或修改内容:
    • 保留符合规范的非默认分支。
    • 在默认分支上,根据工作内容的Conventional Commit类型选择分支名称,然后在重置本地默认分支之前保留所有提交记录和工作区变更:
      bash
      git switch --no-track -c <new-branch>
      git branch -f <default> origin/<default>
    • 使用
      git branch -m <new-branch>
      重命名明显是自动生成的占位分支。
    • 如果用户未要求重命名,遇到其他不符合规范的分支时请停止操作。
  3. 验证分支和工作内容未被修改。如果有任何预期的变更未提交,请停止操作。
  4. 检查提交记录和与默认分支的差异。撰写不超过70个字符的Conventional Commit标题,阅读BODY.md,并撰写差异无法说明的正文内容。
  5. 检查当前分支是否存在已打开的PR。推送时设置跟踪;仅在有意重写提交历史后使用
    --force-with-lease
  6. 使用
    --assignee @me
    创建PR,或更新其标题和正文,使用临时的
    --body-file
    并在之后删除该文件。直接由用户调用时创建就绪状态的PR;自动调用时创建草稿状态的PR,除非用户另有要求。
  7. 返回PR的URL。