Skip to content

Compare versions of a change

List a change's versions with af evolog, and see what changed between two of them with af interdiff, leaving out what main brought in between.

A change keeps its change ID however often it is rewritten; each version is a commit. A reviewer who looked at one version wants to know what changed since, and only that: not what main brought in when the change was rebased. af evolog lists the versions, and af interdiff compares two of them as jj’s does.

A change in three versions

Start a server and land two files:

$ af-server --dev
...
$ source ~/af-dev/dev/env
$ af workspace add ~/mine
Workspace at /home/you/mine
Paths: **
main has no landing yet
$ cd ~/mine
$ af new -m "Add the service"
Working on change zpqwrlsryplzywukupnoqquznppzkput at commit 0441c69e74b70ef855f3efc941e89ea8efe0a491e506e7cd04f7f2cf14868d93
$ printf 'port = 8080\nworkers = 2\n' > service.toml
$ printf 'The service.\n' > README
$ af submit
Submitted commit 65fa9996b0e5b763bf47d9834ca2287a7b2f6b2af1cbdab3415409b971122d8e, 2 edits in its last snapshot
$ af status
Change zpqwrlsryplzywukupnoqquznppzkput (landed) at commit 65fa9996b0e5b763bf47d9834ca2287a7b2f6b2af1cbdab3415409b971122d8e

Start a change, and save a first version of it:

$ af new -m "Tune the service"
Working on change wmutypzkzxxxstmvkuptlnzzxtyzvttu at commit 1028f2416b1085e72b5387a8c8522552310322a705351a1549ed1961a8f266a8
$ printf 'port = 8080\nworkers = 4\n' > service.toml
$ af status
Change wmutypzkzxxxstmvkuptlnzzxtyzvttu (open) at commit 172dc515e1da537e38292dfee3cdc3d37c74339785d898a1048e40f3ee1da378
Based on landing 1
Landing waits for: scan

A reviewer looks at this version. Keep its commit, as af status printed it; the lab keeps it in FIRST:

$ export FIRST=$(af status | sed -n 's/.* at commit \([0-9a-f]*\)$/\1/p')

Meanwhile, someone else lands a change to the readme:

$ af workspace add ~/theirs
Workspace at /home/you/theirs
Paths: **
At landing 1, 2 files written
$ cd ~/theirs
$ af new -m "Explain the service"
Working on change tmounkrpktzvqxxsqmymzqwtwknnwlnw at commit a767e8ac02f4d6c1f9f01d634365b8bd830a86002eefb51af63faf0391616909
$ printf 'The service, which answers on port 8080.\n' > README
$ af submit
Submitted commit 025fcb556a020831fc90b941b447a94e6bf57acdd636d441e9967031e23d965e, 1 edit in its last snapshot
$ af status
Change tmounkrpktzvqxxsqmymzqwtwknnwlnw (landed) at commit 025fcb556a020831fc90b941b447a94e6bf57acdd636d441e9967031e23d965e
Based on landing 1

Back in your workspace, af sync rebases your change onto it, and you edit once more:

$ cd ~/mine
$ af sync
At landing 2: 1 file written, 0 deleted
$ printf 'port = 8080\nworkers = 8\n' > service.toml
$ af status
Change wmutypzkzxxxstmvkuptlnzzxtyzvttu (open) at commit f5c873a5dc0f3981a50731afa9ac9246cdbedf211011ee424817e9f4e30ccf83
Based on landing 2
Landing waits for: scan

List its versions

af evolog lists the change’s versions, newest first, each with the operation that made it and the version it came from: the start, the save the reviewer saw, the rebase onto the readme’s landing, and your last edit:

$ af evolog
f5c873a5dc0f3981a50731afa9ac9246cdbedf211011ee424817e9f4e30ccf83 wmutypzkzxxxstmvkuptlnzzxtyzvttu dev@localhost 2026-11-25T08:20:04Z
    Tune the service
    -- operation 4eea15ee7ec1 from 884b71df978d1a49ee1a2f163b4dac5c1f76e131e43696048781fd9395b8633e
884b71df978d1a49ee1a2f163b4dac5c1f76e131e43696048781fd9395b8633e wmutypzkzxxxstmvkuptlnzzxtyzvttu dev@localhost 2026-11-25T08:20:04Z
    Tune the service
    -- operation c92eb139f6a6 from 172dc515e1da537e38292dfee3cdc3d37c74339785d898a1048e40f3ee1da378
172dc515e1da537e38292dfee3cdc3d37c74339785d898a1048e40f3ee1da378 wmutypzkzxxxstmvkuptlnzzxtyzvttu dev@localhost 2026-11-25T08:20:04Z
    Tune the service
    -- operation d25dcc7f8282 from 1028f2416b1085e72b5387a8c8522552310322a705351a1549ed1961a8f266a8
1028f2416b1085e72b5387a8c8522552310322a705351a1549ed1961a8f266a8 wmutypzkzxxxstmvkuptlnzzxtyzvttu dev@localhost 2026-11-25T08:20:04Z
    Tune the service
    -- operation 0b5eaf771a2e

Compare two versions

af interdiff compares two versions as jj’s does: it takes the edits of --from, rebases them onto the parents of --to, and names each path where they differ from the edits of --to. --to is the change’s latest by default. The readme is not named: main changed it, not you:

$ af interdiff --from $FIRST
M service.toml

af interdiff and af show name paths, as jj interdiff --summary and jj show --summary do; af diff shows the lines of the latest version’s edits. To see a file as the reviewer saw it, af file show prints it at that version:

$ af file show -r $FIRST service.toml
port = 8080
workers = 4
$ af diff
M service.toml
--- a/service.toml
+++ b/service.toml
@@ -1,2 +1,2 @@
 port = 8080
-workers = 2
+workers = 8

The reviewer saw four workers; now there are eight, and nothing else of yours changed.

Next

Type to search…

↑↓ navigate↵ selectEsc close