Skip to main content

Module service_commit

Module service_commit 

Source
Expand description

The commit command’s path through the commit service. What: The commit command’s path through the resident service: prepare the commit in this process (private index, policies), send the prepared change to the service, and report what it landed. Why: The service is the only writer, so a commit takes no lock and polls nothing: preparation and policies run here, outside the service’s serialized step, and the service moves the branch once for a whole batch of commits (doc/planning/cli-git-resident-service.md, “Where preparation and policies run”). Every command line lands through it. The lines service_commit_args.rs accepts are built here from the command line (message and identity options, sign-off, trailers, a reused or fixup message, -a, an index commit, --amend); every other line, and every commit that is not on an ordinary branch with an ordinary state, is built by real Git in a scratch repository and landed as Git made it. Which route a commit takes is decided by service_route.rs; what is prepared is service_prepare.rs.

In TS you’d write (pseudocode):

const result = await tryServiceCommit(invocation, checks, request); // undefined only when no service can be reached

Structs§

ServiceCommit
What the service path returns: the transaction result for the lifecycle, and the handoff when the commit landed.

Constants§

REBUILD_ATTEMPTS
How many times a commit Git built is built again on the new tip when the branch moves before it lands, before the plain failure. A build is one signature, so the bound keeps a busy branch from keeping a person’s command running.

Functions§

try_service_commit
What: Lands the commit through the service when the platform can reach one, for every command line. Why: Returns None only when no service can be reached on this machine, before anything was changed, so the earlier landing runs as it did; every other ending is the commit’s.