Inspecting a commit
Alice has just found out that Bod made changes at the same time as she did.
Before she attempts to somehow create a version that includes both changes, she wants to verify the two changes are compatible.
She therefore decides to check out Bob's changes by using jj show
.
Since the remote bookmark main
is pointing there, she can use that as identification.
jj show main@origin
Commit ID: 8d53839037b21e262e410e087606925f7582914e Change ID: quolxwkkstmturozxxxrkkpxxxnnosry Bookmarks: main?? main@origin Author : Bob <bob@local> (2025-07-22 21:22:17) Committer: Bob <bob@local> (2025-07-22 21:22:22) Document hello.py in README.md The file hello.py doesn't exist yet, because Alice is working on that. Once our changes are combined, this documentation will be accurate. Modified regular file README.md: 1 1: # jj-tutorial 2 2: 3 : This is a toy repository for learning Jujutsu. 3: The file hello.py contains a script that greets the world. 4: It can be executed with the command 'python hello.py'. 5: Programming is fun!
There's a lot of useful information here that jj log
doesn't show.
Let's go over it one-by-one:
-
The first two lines are the commit ID and change ID. We've seen them already, but these ones are longer! That's because the output of
jj log
only shows you a prefix of the full ID. The short prefix is usually enough to uniquely identify a commit, but sometimes you want the whole thing. -
Next is a list of bookmarks pointing to the commit.
-
The following two lines are the author and committer information, as well as their timestamps. Author and committer are usually the same, the difference is not important. If you're curious anyway, there's a short explanation in the info box below.
-
Then there's the commit message. Notice that we see the full description here including its body.
jj log
only displays the subject line to save space. -
Lastly, we see a list of files that have changed in this commit as well as the precise changes of their content. The color green means "added" and red means "removed" So we can see that this commit removed the previous line 3 and replaced it with three new lines. The first line is neutral, indicating that it was not changed in this commit.
Alice is pretty sure that Bob's changes are compatible with hers.
He only changed the file README.md
, while Alice didn't do anything besides adding hello.py
.
Her next task is to create a version of the project that combines both changes.