本技能介绍如何使用命令行`gh`只读查看GitHub issue正文和评论,支持通过编号或URL定位,也可指定其他仓库,并说明如何提取大量评论。
- 查看issue正文和评论
- 通过URL读取issue
- 查看其他仓库的issue
本指南介绍如何在 Carbon 仓库中使用 Jujutsu(jj)管理版本,包括查看状态、差异和历史、提交更改、同步远程内容,以及确定更改栈的基点并谨慎处理历史。
Instructions for using Jujutsu (jj) for version control in the Carbon repository.
实测评分 未实测
查看安装方法本指南介绍在 Carbon 仓库中使用 Jujutsu(jj)进行日常版本管理。内容包括从远程获取更改、在 trunk 上开始新更改、查看仓库状态、历史和差异,以及提交更改。若多个更改组成一个待提交的拉取请求,本指南会说明如何通过书签找出更改栈的基点,并将命令限定在相关范围内。指南还涉及把工作内容合并进已有更改,以及编写更改说明。
当 Carbon 工作副本使用 Jujutsu,而你需要进行常见版本管理操作时,可以参考本指南。它可以帮助你判断更改栈以哪个书签为基点、处理包含评审中更改的栈,并在改写历史前检查可能影响。
仅当仓库根目录存在 .jj 目录时才使用 jj;没有该目录时不要使用。运行 jj 命令时添加 --no-pager。绝不要改写已作为拉取请求提交的更改历史。对其他已有更改执行 squash、rebase、abandon 或 describe 前,应先展示准确命令并等待确认。
本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。
AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。
不计入评分。 由 AI(OpenAI Codex)于 2026年10月26日 评估。仅供参考,安装前请同时查看原文。
安装前可以查看交给 AI 代理的指令内容。
Jujutsu is a Git-compatible version control system that may be used in Carbon checkouts.
[!IMPORTANT] You can detect if Jujutsu is in use by checking for a
.jjdirectory in the repository root. If present, you must usejjand must not usegit. If absent, you must not usejj.
Always use the --no-pager flag when invoking jj to prevent the command from
blocking or waiting for terminal paging.
jj --no-pager git fetchjj --no-pager new trunkjj --no-pager statusjj --no-pager logjj --no-pager diffjj --no-pager commit
jj commit over the combination of jj describe
and jj new.jj --no-pager abandonjj --no-pager rebase -o trunkA change is often built as a stack of commits sent up as a single pull request.
The stack is not necessarily based on trunk; it may be based on another change
that is itself still in flight.
[!WARNING] Never rewrite the history of a change that has been submitted as a pull request. Reviewers track a PR by its commits, and squashing, reordering, or abandoning them discards review that is already in progress. This cannot be undone from their side.
Before rewriting history in any other case, propose the exact command and wait for confirmation. This applies to
squash,rebase,abandon, anddescribeon an existing change.
Bookmarks delimit the stack. List the bookmarks that are ancestors of the working copy, nearest first:
jj --no-pager log -r '::@ & bookmarks()'
Reading the result takes care, because two situations produce similar output:
trunk is only ever a base. Finding trunk nearest means new work is being
built on top of it, never that trunk itself is being worked on.
The graph does not distinguish the two cases: an unbookmarked or empty commit above a bookmark may be the next commit of that change or the start of a new one. Ask which it is when it is not clear, and ask before choosing where a fix should land rather than after. Guessing wrong means squashing into a change that may already be under review.
Once the base is known, use it to scope commands to the current stack:
jj --no-pager log -r '<base-bookmark>..@'
jj --no-pager squash --into <change-id> [path]. Follow-up fixes and
formatter reflows belong in the change that introduced the code, not in a
trailing "fixes" commit, unless that change has already been submitted.
Naming a path squashes only that part of the working copy, leaving unrelated
work in place.还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
本技能介绍如何使用命令行`gh`只读查看GitHub issue正文和评论,支持通过编号或URL定位,也可指定其他仓库,并说明如何提取大量评论。
本技能为在 Carbon 代码库中工作的 AI 助手规定文件查看、搜索和编辑工具,并说明临时文件的存放与清理规则,以及何时可以编写和运行自定义程序。
了解如何在 Carbon 项目中通过 Bazelisk 构建、测试和运行程序,包括指定目标、启用 ASan,以及系统依赖变更后重建缓存。
本技能介绍如何为Carbon编译器添加内置函数,包括类型注册、签名验证、常量求值、运行时LLVM IR生成、Prelude绑定,以及使用最小Prelude编写针对性测试。
了解 Carbon 工具链对 Bazel、C++、Carbon、Markdown 和 Python 文件的格式规范,并查看注释、文档、命名、设计及提交说明的写作要求。
本技能介绍如何在Carbon工具链中添加或修改错误和警告,包括注册诊断类型、用带类型的参数构造消息、为源码位置添加标签和上下文,以及检查措辞规范和测试覆盖。