jujutsu (jj) 0.46.0

本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。

v0.46.0 Latest Latest Compare Choose a tag to compare Sorry, something went wrong. Filter Loading Sorry, something went wrong. Uh oh! There was an error while loading. Please reload this page. No results found View all tags jennings released this 07 Oct 21:28 v0.46.0 7d38231 About jj is a Git-compatible version control system that is both simple and powerful. See the installation instructions to get started.

v0.46.0 最新版本。比较:选择一个标签进行比较。抱歉,出错了。筛选中,加载中。抱歉,出错了。糟糕!加载时发生错误。请刷新此页面。未找到结果。查看所有标签。jennings 发布于 10 月 7 日 21:28,版本 v0.46.0,提交哈希 7d38231。关于:jj 是一个既简单又强大的 Git 兼容版本控制系统。请参阅安装说明以开始使用。

Release highlights Jujutsu can now colocate workspaces besides the default one by creating Git worktrees. Use jj workspace add —[no-]colocate and the setting git.colocate to control this.

发布亮点:Jujutsu 现在可以通过创建 Git 工作树(worktrees)在默认工作区之外并置(colocate)其他工作区。使用 jj workspace add --[no-]colocate 和 git.colocate 设置来控制此功能。

Breaking changes The minimum supported git command version is now 2.42.0, up from 2.41.0. jj workspace add uses git worktree add —orphan, which was added in 2.42.0. The minimum supported Rust version (MSRV) is now 1.97.1. jj bisect run now runs some consistency checks before proceeding to bisect. This helps ensure that the command can tell good and bad revisions apart, and that the working copy does go from bad to good over the provided revset. Use the new flag —trust-endpoints to disable these checks.

重大变更:最低支持的 git 命令版本现为 2.42.0(之前为 2.41.0)。jj workspace add 使用了 2.42.0 中引入的 git worktree add --orphan。最低支持的 Rust 版本 (MSRV) 现为 1.97.1。jj bisect run 现在会在开始二分查找前运行一致性检查。这有助于确保命令能够区分好坏修订版本,并确保工作副本在提供的修订集(revset)上确实从坏变好。使用新标志 --trust-endpoints 可禁用这些检查。

jj split now opens a single editor session to edit descriptions for the split commits. jj undo and jj redo now refuse to undo/redo an operation that was performed in another workspace. Use —allow-cross-workspace to undo/redo it anyway. jj workspace list/root no longer omit unreachable paths. All recorded paths are now shown, with warnings displayed in jj workspace root. The List.get(), .first(), and .last() template functions now return Option instead of throwing an error on out-of-bounds access.

jj split 现在打开单个编辑器会话来编辑拆分提交的描述。jj undo 和 jj redo 现在拒绝撤销/重做在另一个工作区中执行的操作。使用 --allow-cross-workspace 可强制撤销/重做。jj workspace list/root 不再省略不可达路径。现在显示所有已记录的路径,并在 jj workspace root 中显示警告。List.get()、.first() 和 .last() 模板函数现在返回 Option,而不是在越界访问时抛出错误。

New features jj workspace add supports —colocate/—no-colocate flags to control whether a Git worktree is created alongside the workspace. The default colocates when the current workspace is colocated and the git.colocate config is true. jj workspace forget removes the corresponding Git worktree when one exists. jj git colocation status/enable/disable now work on child workspaces. status correctly reports colocation state and includes the workspace name. enable creates a Git worktree and disable removes it, allowing colocation to be toggled after workspace creation. jj workspace remove removes a workspace and its directory from disk. The working-copy state is snapshotted into a commit before removal.

新功能:jj workspace add 支持 --colocate/--no-colocate 标志,以控制是否在工作区旁边创建 Git 工作树。当当前工作区已并置且 git.colocate 配置为 true 时,默认进行并置。jj workspace forget 会在存在时移除相应的 Git 工作树。jj git colocation status/enable/disable 现在适用于子工作区。status 正确报告并置状态并包含工作区名称。enable 创建 Git 工作树,disable 移除它,允许在创建工作区后切换并置状态。jj workspace remove 从磁盘中移除工作区及其目录。工作副本状态在移除前会被快照到一个提交中。

Added commands jj file edit and jj file delete for editing files in any revision without needing to change the working copy. jj git push now supports pushing to multiple remotes at the same time. This can be configured via git.push set to a string pattern or array of string patterns, or with the repeatable —remote flag, which also accepts string patterns. The default target revisions for jj git push can now be configured via revsets.git-push.

新增命令:jj file edit 和 jj file delete,用于在任何修订版本中编辑文件,而无需更改工作副本。jj git push 现在支持同时推送到多个远程仓库。这可以通过将 git.push 设置为字符串模式或字符串模式数组来配置,也可以使用可重复的 --remote 标志(也接受字符串模式)。jj git push 的默认目标修订版本现在可以通过 revsets.git-push 进行配置。

Added the TreeEntry.normal_value() template method and the TreeValue type to access resolved tree values, formatted as their full object IDs, including Git submodule commit IDs. Diff hunk headers now include nearby source symbols for many common programming and markup languages. fix.tools..line-range-args (replaces line-range-arg) is an array of string template args to pass to the fix tool. This is more flexible in cases where you need to pass multiple arguments to the tool, such as separate args for the range start and range end.

添加了 TreeEntry.normal_value() 模板方法和 TreeValue 类型,用于访问解析后的树值,格式化为完整的对象 ID,包括 Git 子模块提交 ID。差异块头现在包含许多常见编程和标记语言的附近源代码符号。fix.tools.<name>.line-range-args(替换了 line-range-arg)是一个字符串模板参数数组,用于传递给修复工具。这在需要向工具传递多个参数(例如范围开始和范围结束的单独参数)时更加灵活。

jj run now uses the sparse patterns from the workspace it’s run from. Use the —sparse-patterns option to control this behavior (evaluated per each jj run invocation). jj util diff to compare files on disk. Aliases now support setting aliases..enabled = false, which will disable them. This can be used to disable built-in aliases or disable aliases in later layers (such as repo config files). ui.editor now supports $path and $line substitution variables. Example: ui.editor = [“emacs”, ”+$line”, “$path”]

jj run 现在使用运行它时所在工作区的稀疏模式(sparse patterns)。使用 --sparse-patterns 选项来控制此行为(在每次 jj run 调用时评估)。jj util diff <path1> <path2> 用于比较磁盘上的文件。别名现在支持设置 aliases.<name>.enabled = false,这将禁用它们。这可用于禁用内置别名或禁用后续层(如仓库配置文件)中的别名。ui.editor 现在支持 $path 和 $line 替换变量。示例:ui.editor = ["emacs", "+$line", "$path"]。

fill template function now supports an additional named parameter break_words, that allows specifying if the template should break words longer than width passed in the input to ensure no words overflow the specified width. The json() template function now supports map literals: json({‘key’ => value}) The hunk headers of diff.color-words.conflict = “pair” now include the conflict labels of the compared terms.

fill 模板函数现在支持一个额外的命名参数 break_words,允许指定模板是否应断开输入中超过宽度的单词,以确保没有单词溢出指定的宽度。json() 模板函数现在支持映射字面量:json({'key' => value})。diff.color-words.conflict = "pair" 的块头现在包含比较项的冲突标签。

Fixed bugs On Windows, jj no longer hangs when a subprocess needs to prompt the user, such as ssh asking for a key passphrase or for confirmation of an unknown host key. Subprocesses started from a terminal now inherit its console, rather than being given an invisible one by CREATE_NO_WINDOW for the prompt to disappear into. #6745 #8547 On Windows, jj git colocation enable and jj git colocation disable no longer fail with “Access is denied (os error 5)” when the Git repository contains pack files. #8661

修复的 Bug:在 Windows 上,当子进程需要提示用户时(例如 ssh 请求密钥密码或确认未知主机密钥),jj 不再挂起。从终端启动的子进程现在继承其控制台,而不是由 CREATE_NO_WINDOW 分配一个不可见的控制台导致提示消失。#6745 #8547。在 Windows 上,当 Git 仓库包含包文件(pack files)时,jj git colocation enable 和 jj git colocation disable 不再因“拒绝访问 (os error 5)”而失败。#8661。

jj undo of jj workspace forget now correctly preserves the workspace’s recorded path. Previously the path metadata was lost, leaving the workspace in a broken state after undo. #9991 at_operation() can now be used with operations that are not ancestors of the current operation (e.g. sibling operations created by concurrent commands). Previously, evaluating such expressions failed if they resolved to commits missing from the current operation’s index.

jj workspace forget 的 jj undo 现在正确保留了工作区记录的路径。此前路径元数据会丢失,导致撤销后工作区处于损坏状态。#9991。at_operation() 现在可以用于非当前操作祖先的操作(例如由并发命令创建的兄弟操作)。此前,如果此类表达式解析为当前操作索引中缺失的提交,则评估会失败。

.gitignore files are now respected even if they aren’t materialized in the working copy because they are excluded by the sparse patterns. Previously, ignored files could become tracked in a sparse working copy. #2289 In-tree ignore files (.gitignore) are no longer read through symlinks, matching git behavior. Such files are now silently skipped instead of having their symlink target applied. $GIT_DIR/info/exclude and core.excludesFile are unaffected and still follow symlinks, as git does. #7161 jj workspace list templates are now labeled with workspace name, workspace root, etc.

即使 .gitignore 文件因稀疏模式被排除而未在工作副本中具体化,现在也会遵循它们。此前,被忽略的文件可能会在稀疏工作副本中被跟踪。#2289。树内忽略文件(.gitignore)不再通过符号链接读取,这与 git 行为一致。此类文件现在会被静默跳过,而不是应用其符号链接目标。$GIT_DIR/info/exclude 和 core.excludesFile 不受影响,仍像 git 一样遵循符号链接。#7161。jj workspace list 模板现在标有工作区名称、工作区根目录等。

Contributors Thanks to the people who made this release happen! Aaron Bies (@slerpyyy) Austin Seipp (@thoughtpolice) Bartok9 (@Bartok9) Brice Figureau (@masterzen) Bryan O’Sullivan (@bos)

贡献者:感谢促成此版本发布的人们!Aaron Bies (@slerpyyy), Austin Seipp (@thoughtpolice), Bartok9 (@Bartok9), Brice Figureau (@masterzen), Bryan O’Sullivan (@bos)。