mq: the command-line specification #
Most merge queues are a service beside a forge. A change waits on a server, a
bot rebases it, and the result comes back as a comment on a review page. mq
is a merge queue that runs where the developer works. mq land replays a
branch on its target, runs the target's checks on the replayed tree, and
fast-forwards the target to the tree that passed, on a laptop with no
network. It lands into one repository. A repository names the ones it builds
with in its own tree, and a change across several lands each half through
its own repository's queue, the dependencies first (Several
repositories).
These pages specify the product as it should be, and the binary does not implement all of it yet.
The design rests on three choices. The unit of work is a Git branch, and its
name is the only name a user types. State is kept where Git keeps it, so
Git's own tools show what mq shows. Each command name says what mq does,
and takes a Git word only when Git's behaviour carries over.
The pages #
| Page | What it specifies |
|---|---|
| rules.md | The two definitions (a check, a checked tree) and the nine rules behind every name and every output. |
| commands.md | Every command, with its arguments and flags. |
| outcomes.md | The block a command prints, with the nine outcome words and the exit codes. |
| runs.md | Who runs the checks: the land that needs them, or the operating system's scheduler. |
| conflicts.md | A conflict, resolved by a command or left in the worktree as a Git rebase. |
| branches.md | What a land leaves behind, the pool of worktrees, a branch based on another, and waiting for a later branch. |
| machines.md | How several machines work offline, reconcile by replay on pull and share their check results. |
| teams.md | Teammates, forges and peers, and how a release is made. |
| configuration.md | The rules on the branch mq/config, and one machine's own keys. |
| trust.md | What mq records about who did what, what it trusts, and the Git mechanisms that bound that trust. |
| sessions.md | Worked sessions, from mq init to a release. |
| naming.md | Every command with its naming verdict. |
| invariants.md | The invariants no command may weaken. |
| related-work.md | The state of the art, and the source of each claim about another tool. |
| design.md | The implementation's own page: its layers, its modules, its state in Git, its loop and recovery, its tests and its open choices. |
A newcomer reads sessions.md, then commands.md and outcomes.md. Whoever implements a command reads rules.md and invariants.md first, then design.md, then the page of its topic.