You realize that Jujutsu moves things from sight for your benefit.
It also saves you from tampering with published commits.
Hidden Changes
Neither Git nor Jujutsu display the commits of the remote branches by default:
$ jj log
@ p (empty)
◆ u main
│
~
Why aren't all the Changes visible?
This is Jujutsu's philosophy: to be very sparing in the information it provides, to show only the strict minimum and omit what's superfluous. In this case, Git behaves the same way.
The idea here is that remote branches contain the work of other developers. Git and Jujutsu assume you're not interested in contributing, so they don't bother creating a local branch and, unless you ask explicitly, they don't even show their commits.
Immutable Changes
Jujutsu goes further: it also assumes you're interested in not
interfering with your colleagues' work. So, it protects all the remote
branches Changes by making them immutable. Ask Jujutsu to show all the
descendants of the Change zzzzzzzzzzzzz, called root():
$ jj log -r 'trunk()::'
@ p (empty)
│ ◆ s foo@origin
├─╯
│ ◆ o bar bar@origin
├─╯
◆ u main
│
~
See how s and o are displayed with a diamond ◆? It means they're
immutable. In fact, you could have verified this by using the Revset
function immutable():
$ jj log -r 'immutable()'
◆ s foo@origin
│ ◆ o bar bar@origin
├─╯
◆ u main
◆ z (empty)
Modifying Immutable Changes
If you run a command that modifies any of those Changes, Jujutsu will stop you in time:
$ jj rebase -r o -o s
jj rebase -r o -o s
Error: Commit fa22ec047bc7 is immutable
Hint: Could not modify commit: ossuomlo fa22ec04 bar bar@origin | (no description set)
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://docs.jj-vcs.dev/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
You can always force your way through with --ignore-immutable.
But, in general, it's always better to declare your intention to work on those branches by creating a tracking Bookmark. That's what you will learn in the next page.