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 reachedStructs§
- Service
Commit - 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§
- service_
commit - What: Lands the commit through the service, for every command line. Why: The service is the only writer of a commit. A machine where none can be reached or started ends the command with the plain message of its platform, before anything was changed; every other ending is the commit’s.