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 fetchnow 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. Runningjj git fetchin an existing repository will re-fetch all tags to initialize the tracking state.- Git’s
tagOptis no longer respected. To disable tag fetching, setremotes.<name>.fetch-tags = '~*'in the jj configuration. jj git clone --fetch-tags=all|none|includedis removed in favor of--tag=PATTERN.jj git push --allnow pushes all tags in addition to bookmarks.- The
WorkspaceRef.root()andRepoPath.absolute()template functions now returnOption<FsPath>andFsPathrespectively, instead ofString. Thepathkeyword injj config listtemplates now returnsOption<FsPath>. jj file searchnow prints every matched line prefixed by the file path, instead of only the file paths of files containing a match. Use--name-onlyfor 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 versionandjj log -n 5 -n 10now 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--configandjj 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,而不是String。jj config list模板中的path关键字现在返回Option<FsPath>。 jj file search现在会打印每一行匹配内容并加上文件路径前缀,而不是仅打印包含匹配项的文件路径。使用--name-only可恢复之前的行为。#9399- 多次传递同一个参数不再报错。最后一次出现的值生效,因此
jj --no-pager --no-pager version和jj log -n 5 -n 10现在可以正常工作,别名或包装器中预设的参数也可以被显式覆盖。可以多次指定的参数(如--config和jj log -r)不受影响,仍会收集所有值。#8101 #9859
Deprecations None
弃用项 无
New features
- New
merge_point()revset function which (similar tofork_point) finds the point where multiple branches merge. jj workspace listnow shows workspace roots by default. The output can be customized withtemplates.workspace_listor-T, andWorkspaceRef.root()returns an optionalFsPathvalue. #9713, #9826- New
try(expr, fallback...)template function to suppress runtime errors. jj runnow 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--jobshigher than 1.jj rungained a--passthroughflag that connects the subprocess’s stdout/stderr directly to the terminal instead of capturing output.jj rungained a--ignore-changesflag to avoid editing any revisions even if the command modifies the working copy.jj rungained a--ignore-errorsflag to continue running against the remaining revisions even if the command exits with a nonzero exit code.jj file searchnow supports-n/--line-numberto prefix each match with its 1-based line number within the file.jj git pushgained a--allow-conflictsflag to allow pushing commits containing conflicts.- New
jj tag track/untrackcommands to associate local tags with remotes. Note that fetched tags are tracked by default. - Added
builtin_log()revset alias for the built-in defaultjj logrevset.revsets.lognow defaults tobuiltin_log(), so custom log revsets can reuse the built-in default instead of copying its full expression. - Added config option
diff.stat.max-bar-widthfor use with--statto limit the++--bar width. In the templating language,diff.stat()can optionally take a second (positional or named) argumentmax_bar_widthfor an equivalent effect. jj absorbnow supports--interactive/-i/--toolto 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 diffandjj statusno longer omit a rename or copy in a merge commit when the renamed source is present in more than one parent.jj runno 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 importandexportin colocated workspaces are now disabled by default.
修复的 Bug
- 更精确地检测递归别名定义。
- 在接收到信号(如 Ctrl-C)时,Git 临时文件的清理更加可靠。
- 修复了工作副本变为不可变后 Git HEAD 不匹配的问题。#9827
- 如果工作副本包含名称不是有效 UTF-8 的路径,快照操作不再失败。
- 修复了在具有空仓库级配置目录的复制仓库中读取配置时的失败问题。
jj diff和jj status不再在合并提交中忽略重命名或复制,即使重命名源存在于多个父提交中。jj run在其修订集包含冲突提交时不再崩溃(panic)。- 修复了向 ID 模板函数传递过大长度参数时导致的崩溃。#9833
- 同位工作区(colocated workspaces)中的
jj git import和export现在默认禁用。