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”).
This slice covers the plain scoped commit (git commit -m <message> -- <paths>); 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 native git commit handles them as before. It is on only when the person opts in.
In TS you’d write (pseudocode):
const result = await tryServiceCommit(invocation, checks, request); // undefined when native git commit must runStructs§
- Service
Commit - What the service path returns: the transaction result for the lifecycle, and the handoff when the commit landed.
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
Nonefor everything else, before anything was changed, so nativegit commitruns unchanged.