Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Hidden Changes

Important

You see how Jujutsu hides information to keep things clean, preventing you from tampering with published commits.

By default, neither Git nor Jujutsu display commits from remote branches:

jj log
@  p    (empty)
◆  u    **main**
│
~

Why hide them?

Jujutsu is parsimonious: it shows only the strict minimum information. Git behaves similarly, but Jujutsu is even stricter (you’ve surely noticed: jj log often omits Changes replacing whole branches with a ~ symbol).

The idea is that remote branches contain other people’s work. Unless you ask, Git and Jujutsu assume you aren’t contributing to them, so they hide the commits and won’t create local tracking branches.

Immutable Changes

Jujutsu goes even further: assuming you shouldn’t interfere with colleagues’ work, unless you directly say you want, it protects remote branches by making their Changes immutable.

See. Log all the descendants of the root() Change (zzzzzzzzzzzzz):

jj log -r 'trunk()::'
@  p    (empty)
│ ◆  s    **foo@origin**
├─╯
│ ◆  o    **bar** **bar@origin**
├─╯
◆  u    **main**
│
~

The diamond means u, o and s are immutable. You would get the same information using the immutable() Revset function:

jj log -r 'immutable()'

Modifying Immutable Changes

What if you try to modify an immutable Change? Jujutsu will stop you:

jj edit -r o
Error: Commit fa22ec047bc7 is immutable

This is safer that Git, which lets you tamper with published commits, only to complain later when you push.

You can always force edits with --ignore-immutable, but it’s better to declare your intent by creating a tracking Bookmark. We’ll cover that in the next page.