How it works

From your push
to main.

Push a branch as you do today, or a stack of small commits. Either way, this is what happens to it: six stops, each one a working model.

01 / A change

A change
keeps its name.

Whatever you push becomes a change: the unit that is reviewed and landed. It outlives every commit that carries it.

A branch is a change
Push a branch the way you would open a pull request. Its commits arrive as one change, and nothing of yours is rewritten.
So is a single commit
Give a commit a Change-Id, or use jj, and it is a change of its own. A chain of them is a stack.
It keeps its name
Push again and the commit is a new one. The change is the same one: a new revision of it, not a new thing to review.
A rebase, or an edit
Berrit rebases the old revision onto the new parent. The same tree is a rebase: nothing approved has changed. Anything else is an edit.
acme / rulesone change, however it arrives
Push again

#142Parse OWNERS filesIn review

change id
I8f3a2c1d
stays
commit
a41c9e2
new with every push
  1. 1initial

A branch of three commits came in as change #142. Push to it again and see what Berrit makes of it.

02 / A stack

A stack is read,
not kept.

Send several commits and they are a stack of changes. One commit, or one branch, is simply a stack of one.

Read from the commits
A stack is the chain your commits already form: each change stands on the one below. Berrit stores no stack, so there is nothing to keep in sync.
Reviewed one at a time
Every change has its own diff, its own review and its own approvals. The first can be approved while you are still writing the third.
Landed alone, or as one
Ask to land a change alone, or with the stack below it. Together they are one unit: tested as one, landed by one fast-forward, set aside whole.
Order across repositories
A line Depends-On: api#17 in a commit message makes a change wait until that one has landed. It orders; it tests nothing together.
git log main..the same three commits, as Berrit reads them
Ask to land
  1. 3f9c2a1main
  2. a41c9e2#142Parse OWNERS filesApproved
  3. 7be0d15#143Compile OWNERS to rulesApproved needs api#17 Lease API In review
  4. c93f6a8#144Suggest reviewers from rulesIn review

A unit of two, #142 and #143. Both are approved, so it enters the train, is tested as one and lands by one fast-forward. If it fails, it leaves whole.

03 / Review and attention

Always
someone’s turn.

A change is never merely open. Each thing that happens to it moves the turn, so nobody has to remember whose it is.

Drafts, then one review
Comments are private drafts until you publish. One review carries them all, with a vote or none: one entry in the conversation.
Then it is someone’s turn
Send a revision and the turn is the reviewers’. Publish a review and it is the author’s again. The dashboard is the list of your turns.
Bad news goes to the author
A conflict, an ejection or a failed check gives the author the turn, with the reason. Nobody else is told.
An edit asks again
Edit an approved change and the approval still counts, unless your rules say otherwise. The approver gets the turn, with only what changed.
#142 Parse OWNERS fileswhat happens, and whose turn it makes it

Mayaauthor

Theoreviewer

  • draft
  • draft
  • draft
  1. Maya sent revision 1

Maya sent revision 1, so the turn is Theo’s. His three comments are drafts: nobody has seen them.

04 / The candidate

Rebuilt on
a moving tip.

While a change waits for review, main moves and other changes queue up. Berrit keeps working out what yours would land as.

Built for you, kept fresh
For every open change Berrit keeps a candidate: your revision rebased onto the tip, with everything already queued applied first. You never rebase to find out.
Conflicts, days early
The moment a candidate conflicts, its author hears: which files, and which change caused it. Nothing is run and nobody else is told.
Never a revision
A candidate is Berrit’s commit, not yours. It never appears among your revisions, and it is what the train tests and lands.
Already on main?
If main has the work already, by a cherry-pick or a pull request merged on the forge, the change is marked landed. Nothing is pushed for it.
acme / rules · mainwhat #142 would land as, right now
Meanwhile
tip of main3f9c2a1
candidate of #142e07b44dClean
Revisions Maya sent
1
Candidates Berrit built
1

Nothing is queued, so the candidate is #142 rebased onto the tip of main. It applies cleanly.

05 / The train

The last candidate
carries the rest.

Approved changes that asked to land queue up in order. The train tests one commit and lands many, always by fast-forward.

A chain of candidates
Each queued change’s candidate is built on the one ahead of it. The fourth is exactly what main would be once the first four have landed.
Test the last one
So a run on the last candidate tests them all. When it passes, everything up to it lands by one fast-forward.
Find the one that fails
When it fails, the train runs the candidate in the middle of what it does not yet know, until one change fails right behind a pass. That one is ejected with its reason, and the rest are built again.
What a batch proves
In a batch only the last candidate is tested as a commit. The changes before it reach main as its ancestors: tested in it, and not alone. Related research, not Berrit’s numbers: batch testing and bisection, 2019 · parallel batch testing, 2023
Train · mainfive changes, in the order they entered
Press a change to make its checks fail.

Each line is a candidate: it holds every change it runs under.

Runs
0
Landed
0
Ejected
0

Five candidates, each built on the one ahead. The longest holds all five changes.

06 / Landed

Then it is
on main.

Fast-forward only. The tip of main is the very commit a run passed on, and it still carries the change id it was reviewed under.

The turn is cleared, and berrit sync drops what landed from your local stack and rebases the rest. On a branch, pull main as you always have.

your terminalafter the train
$ berrit sync
#142  landed   Parse OWNERS files
#143  rebased  Compile OWNERS to rules
#144  rebased  Suggest reviewers from rules