jujutsu 0.44.0

jujutsu 0.44.0

About jj is a Git-compatible version control system that is both simple and powerful. See the installation instructions to get started.

关于 jj 是一个既简单又强大的 Git 兼容版本控制系统。请参阅安装说明以开始使用。


Release highlights Support for fetching and pushing tags has now been stabilized. Tags can be tracked or untracked just like bookmarks. Tracked tags are pushed by default.

发布亮点 获取和推送标签(tags)的支持现已稳定。标签可以像书签(bookmarks)一样进行跟踪或取消跟踪。被跟踪的标签默认会被推送。


Breaking changes

  • jj git fetch now fetches tags the same way it fetches bookmarks. Tags are fetched as <name>@<remote>, and these remote tags are automatically tracked by local tags of the same name. Running jj git fetch in an existing repository will re-fetch all tags to initialize the tracking state.
  • Git’s tagOpt is no longer respected. To disable tag fetching, set remotes.<name>.fetch-tags = '~*' in the jj configuration.
  • jj git clone --fetch-tags=all|none|included is removed in favor of --tag=PATTERN.
  • jj git push --all now pushes all tags in addition to bookmarks.
  • The WorkspaceRef.root() and RepoPath.absolute() template functions now return Option<FsPath> and FsPath respectively, instead of String. The path keyword in jj config list templates now returns Option<FsPath>.
  • jj file search now prints every matched line prefixed by the file path, instead of only the file paths of files containing a match. Use --name-only for the previous behavior. #9399
  • Passing an argument more than once is no longer an error. The last occurrence wins, so jj --no-pager --no-pager version and jj log -n 5 -n 10 now work, and an argument baked into an alias or a wrapper can be given explicitly as well. Arguments that can be specified multiple times, such as --config and jj log -r, are unaffected and still collect all of their values. #8101 #9859

重大变更

  • jj git fetch 现在获取标签的方式与获取书签相同。标签将以 <name>@<remote> 的形式获取,并且这些远程标签会自动由同名的本地标签跟踪。在现有仓库中运行 jj git fetch 将重新获取所有标签以初始化跟踪状态。
  • 不再支持 Git 的 tagOpt。要禁用标签获取,请在 jj 配置中设置 remotes.<name>.fetch-tags = '~*'
  • jj git clone --fetch-tags=all|none|included 已被移除,改为使用 --tag=PATTERN
  • jj git push --all 现在除了推送书签外,还会推送所有标签。
  • 模板函数 WorkspaceRef.root()RepoPath.absolute() 现在分别返回 Option<FsPath>FsPath,而不是 Stringjj config list 模板中的 path 关键字现在返回 Option<FsPath>
  • jj file search 现在会打印每一行匹配内容并加上文件路径前缀,而不是仅打印包含匹配项的文件路径。使用 --name-only 可恢复之前的行为。#9399
  • 多次传递同一个参数不再报错。最后一次出现的值生效,因此 jj --no-pager --no-pager versionjj log -n 5 -n 10 现在可以正常工作,别名或包装器中预设的参数也可以被显式覆盖。可以多次指定的参数(如 --configjj log -r)不受影响,仍会收集所有值。#8101 #9859

Deprecations None

弃用项


New features

  • New merge_point() revset function which (similar to fork_point) finds the point where multiple branches merge.
  • jj workspace list now shows workspace roots by default. The output can be customized with templates.workspace_list or -T, and WorkspaceRef.root() returns an optional FsPath value. #9713, #9826
  • New try(expr, fallback...) template function to suppress runtime errors.
  • jj run now processes revisions from oldest to newest by default. The start order is guaranteed: each revision begins execution only after the previous one has started, even with --jobs higher than 1.
  • jj run gained a --passthrough flag that connects the subprocess’s stdout/stderr directly to the terminal instead of capturing output.
  • jj run gained a --ignore-changes flag to avoid editing any revisions even if the command modifies the working copy.
  • jj run gained a --ignore-errors flag to continue running against the remaining revisions even if the command exits with a nonzero exit code.
  • jj file search now supports -n/--line-number to prefix each match with its 1-based line number within the file.
  • jj git push gained a --allow-conflicts flag to allow pushing commits containing conflicts.
  • New jj tag track/untrack commands to associate local tags with remotes. Note that fetched tags are tracked by default.
  • Added builtin_log() revset alias for the built-in default jj log revset. revsets.log now defaults to builtin_log(), so custom log revsets can reuse the built-in default instead of copying its full expression.
  • Added config option diff.stat.max-bar-width for use with --stat to limit the ++-- bar width. In the templating language, diff.stat() can optionally take a second (positional or named) argument max_bar_width for an equivalent effect.
  • jj absorb now supports --interactive/-i/--tool to let you interactively choose which hunks from the source to consider for absorption.

新功能

  • 新增 merge_point() 修订集(revset)函数,类似于 fork_point,用于查找多个分支合并的点。
  • jj workspace list 现在默认显示工作区根目录。输出可以通过 templates.workspace_list-T 自定义,且 WorkspaceRef.root() 返回可选的 FsPath 值。#9713, #9826
  • 新增 try(expr, fallback...) 模板函数以抑制运行时错误。
  • jj run 现在默认从旧到新处理修订版本。执行顺序得到保证:即使 --jobs 大于 1,每个修订版本也仅在前一个版本开始执行后才开始。
  • jj run 增加了 --passthrough 标志,将子进程的 stdout/stderr 直接连接到终端,而不是捕获输出。
  • jj run 增加了 --ignore-changes 标志,即使命令修改了工作副本,也能避免编辑任何修订版本。
  • jj run 增加了 --ignore-errors 标志,即使命令以非零退出码退出,也能继续对剩余的修订版本运行。
  • jj file search 现在支持 -n/--line-number,在每个匹配项前加上其在文件中的 1-based 行号。
  • jj git push 增加了 --allow-conflicts 标志,允许推送包含冲突的提交。
  • 新增 jj tag track/untrack 命令,用于将本地标签与远程关联。注意,获取的标签默认会被跟踪。
  • 为内置的默认 jj log 修订集添加了 builtin_log() 修订集别名。revsets.log 现在默认为 builtin_log(),因此自定义日志修订集可以重用内置默认值,而无需复制其完整表达式。
  • 添加了配置选项 diff.stat.max-bar-width,用于 --stat 以限制 ++-- 条的宽度。在模板语言中,diff.stat() 可以选择性地接受第二个(位置或命名)参数 max_bar_width 以达到同样的效果。
  • jj absorb 现在支持 --interactive/-i/--tool,允许你交互式地选择源中哪些代码块(hunks)需要被吸收。

Fixed bugs

  • Recursive alias definitions are detected more precisely.
  • Git temporary files are now cleaned up more reliably in the presence of signals (e.g. Ctrl-C).
  • Fixed Git HEAD mismatch after the working copy became immutable. #9827
  • Snapshotting no longer fails if the working copy contains a path whose name isn’t valid UTF-8.
  • Fixed failure when reading configuration in copied repo with an empty repo-level configuration directory.
  • jj diff and jj status no longer omit a rename or copy in a merge commit when the renamed source is present in more than one parent.
  • jj run no longer panics when its revset includes a conflicted commit.
  • Fixed a panic when passing overly-large length parameters to ID templater functions. #9833
  • jj git import and export in colocated workspaces are now disabled by default.

修复的 Bug

  • 更精确地检测递归别名定义。
  • 在接收到信号(如 Ctrl-C)时,Git 临时文件的清理更加可靠。
  • 修复了工作副本变为不可变后 Git HEAD 不匹配的问题。#9827
  • 如果工作副本包含名称不是有效 UTF-8 的路径,快照操作不再失败。
  • 修复了在具有空仓库级配置目录的复制仓库中读取配置时的失败问题。
  • jj diffjj status 不再在合并提交中忽略重命名或复制,即使重命名源存在于多个父提交中。
  • jj run 在其修订集包含冲突提交时不再崩溃(panic)。
  • 修复了向 ID 模板函数传递过大长度参数时导致的崩溃。#9833
  • 同位工作区(colocated workspaces)中的 jj git importexport 现在默认禁用。