Skip to main content

Module service_native

Module service_native 

Source
Expand description

The commits real Git builds for the service: an editor, a signature, and what the service does not embed. What: The commits real Git builds for the commit service: an editor, a signature, and every command line the service does not build itself. Why: Git owns the editor, the signer and the message semantics of whatever the service cannot embed, so this module points real git commit at a thin scratch repository (its HEAD and branch at the base, the policy-settled private index, the real configuration included, every hook off) whose new objects go straight into the real object store. Nothing is locked and nothing is registered: the scratch repository sits inside the commit’s own scratch directory, is removed with it, and the commit it makes is only an object until the service moves the branch to it by compare-and-swap (doc/planning/cli-git-resident-service.md, “Commits Git builds”).

In TS you’d write (pseudocode):

const { commit, parents } = await buildWithGit({ context, cwd, capture, scratch, commitIndex, arguments });

Structs§

BuildInput
Everything the build needs from the preparation that settled the private index.
GitBuilt
What the scratch repository’s git commit made.

Functions§

build_with_git
What: Runs real git commit against the scratch repository and reads the commit it made. Why: Git’s own output, editor and signer reach the person’s terminal as they would from a plain git commit; a nonzero status of Git is the command’s status and nothing lands.
message_of
The message after the header block of a stored commit.
parents_of
The parents named by a stored commit’s header block.
private_invocation
What: The kept global options and the commit options of the arguments, with the pathspecs and the selection options the private index already holds removed. Why: Real git commit must commit the private index as it stands, so it is given neither the paths nor -a.