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

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.

The difference between author and committer

The author of a commit is the primary person who wrote its content. In this case, that refers to the new paragraph being added to the readme. The committer on the other hand is the person who created the commit. Again, these are usually the same, because most of the time the person who writes something also immediately puts that in a commit.

Let's imagine a scenario where that's not the case.

Before they started doing any work, Alice and Bob are joined by Claire as a third member of the team. Claire is not comfortable using version control yet, so they decide that Claire will write the documentation instead of Bob. Bob on the other hand will record Claire's changes in version control for safe keeping. That way, everyone can contribute something.

Claire writes the documentation and sends the README.md file to Bob as an attachement by email. Bob copies the file into his repository, recording it into the working copy commit as normal. He want's to preserve Claire's authorship information, so he runs the command:

jj describe --author "Claire claire@local" --no-edit

That command will overwrite the author information in the commit on a one-off basis. The committer field will continue to contain Bob's information. The result will look like this:

Commit ID: 8d53839037b21e262e410e087606925f7582914e
Change ID: quolxwkkstmturozxxxrkkpxxxnnosry
Bookmarks: main?? main@origin
Author   : Claire <claire@local> (2025-07-22 21:22:17)
Committer: Bob <bob@local> (2025-07-22 21:22:22)

    ...

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.