SwarmOps
ReferenceCommandsswarmops push

Page kind: Reference

swarmops push#

Describes stable at 1c729452, ; latest release v0.11.0what changedLast changed View as Markdown

Send a store ref to a remote branch by compare-and-swap, never by force: the remote moves only from the head the last fetch saw, to a descendant of it.

The ref is exported into the store's mirror on top of what the last fetch saw of the branch, so the export only appends, then git pushes it with a lease on that value. A remote that moved since fails with E_REMOTE_DIVERGED (exit 3) and nothing is sent: fetch, or sync. Run again, it sends nothing and starts no git. It needs no identity: a push is an export.

Metadata
Group
remotes
Since
0.2.0
Mutates
yes
Identity required
no
MCP tool
push
Envelope op
push
Exit codes
0
Errors
none

Syntax#

Syntax
swarmops push [OPTIONS] <REMOTE> [REF[:BRANCH]]

Required arguments#

Syntax: <REMOTE>.

The remote, by its name.

Optional arguments#

The command also takes the global options.

Syntax: <REF[:BRANCH]>.

What to send, as <ref>[:<branch>]: the store ref (main, the default, release/<name>, or in a FORMAT 2 store a branch (feature/x), not a tag) and the remote branch (by default the remote's followed branch for main, the same name for any other ref).

Examples#

No recorded example yet.

No recorded example yet.

Return information#

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

FieldTypeRequiredDescription
branchstringyesThe remote branch.
head_changesetstringyesThe changeset at the store ref's head.
newstringyesThe commit the branch names now: the export of head_changeset.
objects_writtenintegeryesHow many git objects the push's export wrote into the mirror.
oldstring or nullnoThe commit the branch named before; omitted when it did not exist.
remotestringyesThe remote, by its name.
rewrittenintegeryesHow many of the exported commits have another id than the commit they were imported from, as git export's rewritten.
statusPushStatusyesWhat the push did.
warningsarray of string or nullnoWhat the push has to say that did not stop it. Omitted when there is nothing.

Envelope op: push.

Exit codes:

  • 0: Success.

Errors#

No golden step shows this command failing yet.

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