SwarmOps
ReferenceCommandsswarmops land-check

Page kind: Reference

swarmops land-check#

Describes v0.11.0Last changed View as Markdown

Say what landing changes in order onto a ref would come to, writing nothing.

Each HEAD, with its first-parent chain since its merge base with the ref's head, is merged onto what the clean ones before it make, as land would land them one after another: clean, with the root tree its landed changeset would have and the paths it changes; replayed; nothing_to_land; or conflict, with the report land gives in E_CONFLICT. It takes no lock and writes nothing, and exits 0 whatever the outcomes. A HEAD not found, or a merge in a chain, fails the whole check as it fails a land.

Metadata
Group
write
Since
0.11.0
Mutates
no
Identity required
no
MCP tool
land_check
Envelope op
land_check
Exit codes
012

Syntax#

Syntax
swarmops land-check [OPTIONS] <HEAD>...

Required arguments#

Syntax: <HEAD>.

The changes' heads, in the order they would land: 1 to 32.

Optional arguments#

The command also takes the global options.

Syntax: --onto <REF>. Default: main.

The ref they would land on: main or a release ref (release/NAME).

Syntax: --max-conflict-bytes <N>. Default: 32768.

The most bytes of hunk text each conflicting change's report carries, as land's.

Examples#

Shell
swarmops --repo [tmp]/store land-check [first] [second] [third]
Output
{ "ok": true, "op": "land_check", "api": 1, "result": { "onto": "[t0]", "items": [ {
Show 77 more lines "head": "[first]", "outcome": "clean", "root": "[first_root]", "paths": [ { "path": "f.txt", "change": "modified" } ] }, { "head": "[second]", "outcome": "clean", "root": "[second_root]", "paths": [ { "path": "g.txt", "change": "added" } ] }, { "head": "[third]", "outcome": "conflict", "report": { "base": "[t0]", "ours": "[third]", "theirs": "[t0]", "files": [ { "path": "f.txt", "kind": "content", "base_blob": "[id4]", "ours_blob": "[id5]", "theirs_blob": "[id6]", "hunks": [ { "id": 0, "base": { "first": 2, "last": 2, "text": "2\n" }, "ours": { "first": 2, "last": 2, "text": "C\n" }, "theirs": { "first": 2, "last": 2, "text": "A\n" } } ] } ], "kinds": [ "content" ], "truncated": false } } ] }, "meta": { "repo": "[tmp]/store", "elapsed_ms": "[elapsed_ms]", "resolved": { "[first]": "[first]", "[second]": "[second]", "[third]": "[third]", "main": "[t0]" }, "auth": "trust" } }

Exit code 0. Recorded by the CLI tests. A name in square brackets, such as [tmp] or [c1], stands for what differs from run to run: the test's temporary directory, an id, a time.

No recorded example yet.

Return information#

result is a LandCheckResp (swarmops schema LandCheckResp prints its JSON Schema).

FieldTypeRequiredDescription
itemsarray of LandCheckItemOutyesEach change's outcome, in the request's order.
ontostringyesThe target's head the changes were planned on: a land with expect_target set to it lands what the check found, or nothing.

Envelope op: land_check.

Exit codes:

  • 0: Success.
  • 1: The operation failed.
  • 2: The request or the command line is malformed.

Errors#

  • E_TOO_LARGE (exit 1): The content is larger than the operation allows.
  • E_INVALID_ARG (exit 2): A malformed argument or request, including a command-line usage error.

Any command that opens a store may also fail with a store error, such as E_NOT_A_REPO, E_IO or E_STORE_CORRUPT; a command line the grammar refuses is E_INVALID_ARG (exit 2).

See also#

On this page