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”). It covers the commit lines service_commit_args.rs accepts (message and identity options, sign-off, trailers, a reused or fixup message, -a, an index commit, and --amend); any other command line, a commit in a merge, on an unborn branch or on a detached head, a policy that rewrites a file, and anything with nothing to commit return None so the transaction handles them as before. Which route a commit takes is decided by service_route.rs.

In TS you’d write (pseudocode):

const result = await tryServiceCommit(invocation, checks, request); // undefined when native git commit must run

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 person opted in and the command line is one the service covers. Why: Returns None for everything else, before anything was changed, so native git commit runs unchanged.