v0.40.0

d2lang/d2v0.40.0Apr 2, 2026by martinvonz

AI Summary

Released a major update for the jj version control system, introducing new revset functions, template improvements, and enhanced UI features for the arrange command.

Key Highlights

  • New `diff_lines_added()` and `diff_lines_removed()` revset functions
  • Optional `end` parameter in the `String.substr()` templating method
  • New `.root()` method for `WorkspaceRef` templates
  • Enhanced `jj arrange` TUI with immediate parents and configurable diff colors
  • Dynamic configuration lookup via `config()` template function

New Features

  • Revset functions for diff analysis
  • Template method updates
  • TUI graph and color improvements

Full Release Notes

### About

jj is a Git-compatible version control system that is both simple and powerful. See
the [installation instructions](https://jj-vcs.github.io/jj/v0.40.0/install-and-setup/) to get started.

### Release highlights

None

### Breaking changes

None

### Deprecations

None

### New features

* New `diff_lines_added()` and `diff_lines_removed()` revset functions for
  matching content on only one side of a diff.

* The `end` parameter in the `String.substr(start, end)` templating method is
  now optional. If not given, `substr()` returns from `start` to the end of the
  string.

* `WorkspaceRef` templates now provide a `.root()` method to show the absolute
  path to each workspace root.

* The `jj arrange` TUI now includes immediate parents and children. They are not
  selectable and are dimmed by default.

* `jj arrange` uses the default log template (`builtin_log_compact`) instead of
   the shorter commit summary style.

* In the `jj arrange` TUI, the "swap up/down" actions now move along graph edges
  even if the commit rows are not adjacent.

* [Diff colors](docs/config.md#diff-colors-and-styles) can now be configured
  differently for each format.

* `jj op log` now includes the name of the workspace the operation was created
  from.

* The `config()` template function now accepts a `Stringify` expression instead
  of `LiteralString`. This allows looking up configuration values dynamically.

* `jj op show`, `jj op diff`, `jj op log -p` now only show "interesting"
  revisions by default (defined by `revsets.op-diff-changes-in`). A new flag,
  `--show-changes-in`, can be used to override this. [#6083](https://github.com/jj-vcs/jj/issues/6083)

### Fixed bugs

* `.gitignore` with UTF-8 BOM can now be parsed correctly.

* Fix incompatibility with gpgsm 2.5.x.

### Contributors

Thanks to the people who made this release happen!

* Aaron Sutton (@aaronjsutton)
* Adam Sandberg Eriksson (@adamse)
* Anton Älgmyr (@algmyr)
* Austin Seipp (@thoughtpolice)
* Benjamin Tan (@bnjmnt4n)
* Ben Warren (@warrenbhw)
* Bryant Chandler (@brychanrobot)
* David Higgs (@higgsd)
* Filip Weiss (@fiws)
* Gabriel Goller (@kaffarell)
* Gaëtan Lehmann (@glehmann)
* Ilya Grigoriev (@ilyagr)
* Jeff Turner (@jefft)
* Joseph Lou (@josephlou5)
* Josh Steadmon (@steadmon)
* KITAGAWA Yasutaka (@kit494way)
* Liam (@terror)
* Li-Wen Hsu (@lwhsu)
* Martin von Zweigbergk (@martinvonz)
* Philip Metzger (@PhilipMetzger)
* Poliorcetics (@poliorcetics)
* Remo Senekowitsch (@senekor)
* Rob Pilling (@bobrippling)
* Scott Taylor (@scott2000)
* Shnatu
* Stephen Prater (@stephenprater)
* Yuya Nishihara (@yuja)
* Zeyi Fan (@fanzeyi)