Skip to main content

Module push

Module push 

Source
Expand description

push handler with per-ref locking via conditional writes.

Sequential-batch semantics: every push <refspec> line in a batch is processed in order under its own per-ref lock, and one outcome line is emitted per push (ok <ref>\n or error <ref> "msg"\n). gix::Repository is !Sync so the handler holds the repo handle on a single task — pushes never run in parallel within one client.

Stdout discipline: this module returns PushOutcome values and never writes to the protocol stream itself. The REPL renders each outcome and the trailing blank-line terminator (see .claude/rules/protocol-stdout.md).

Enums§

PushError
Errors surfaced by the push path. These abort the helper — per-ref failures (multi-bundle, ancestor mismatch, lock contention, …) are returned as PushOutcome::Error without aborting the batch.
PushOutcome
Result of a single push within a batch. Rendered to stdout by the REPL as either ok <ref>\n or error <ref> <msg>\n.

Constants§

DEFAULT_LOCK_TTL_SECONDS
Default per-ref lock TTL (seconds) when [ENV_LOCK_TTL_SECONDS] is unset or unparseable. Single source of truth for the lock TTL — manage::doctor’s stale-lock predicate, the CLI’s --lock-ttl-seconds default (resolved through [lock_ttl_from_env] when the flag is unset), and integration-test wire-format pinning all consume this constant (the management surface re-exports it from crate::manage::DEFAULT_LOCK_TTL_SECONDS) so the views of “stale” cannot drift silently.