Skip to main content

Module auto_push

Module auto_push 

Source
Expand description

Post-commit auto-push of a landed commit: the push argv, the surfaced output and the failure reporting. What: The commit service’s push of a landed commit’s branch: which push runs, what its output shows, and how a failure is reported without failing the commit. Why: Every commit in this repository is backed up (AGENTS.md rule APG), the service pushes the branch its record names and never reads HEAD, prints only GitHub remote: lines on success and the full output on failure, and leaves a notice for the next command when the push fails. The service is the only pusher of the repositories it serves and coalesces pending pushes of one branch into one call, so the push needs no lock.

In TS you’d write (pseudocode):

await pushOnce({ gitPath, cwd }, branchRef, landedOid);

Structs§

AutoPushResult
What: The result of one auto-push attempt. Why: shown is what the terminal received, so tests compare the surfaced text directly.

Enums§

AutoPushOutcome
What: Which branch the auto-push took. Why: Skipped covers both “nowhere to back up to” and a setting under which Git pushes the branch nowhere; the first exits 0 silently, the second with a note that the person must see.

Constants§

PUSH_FAILED_NOTE
Note printed after every failed push: the commit stays local.
PUSH_LOCK_RETRIES
How many times the service pushes again when a held reference lock refused the update of a remote-tracking reference.

Functions§

filter_push_output
What: Select the output a push shows: only remote: lines after a clean push, everything after a failure. Why: A rejection, a hook refusal or an offline error stays diagnosable only when the full output shows.
push_once
What: Push a landed commit’s branch once, with no coordination with other processes. Why: The service’s push consumer is the only pusher of the repositories it serves and coalesces pending pushes of one branch into this single call, so it needs no lock.