Skip to main content

Module push_trigger_log

Module push_trigger_log 

Source
Expand description

The record of each decision of the push trigger: handed over, or declined with its reason. What: The record of every decision of the push trigger after a command that adds commits: handed over, or declined with the step that declined and why. Why: A merge that was never pushed left nothing to look at, because the trigger returned silently at eight places and the reason sat only in the code. The record is one JSON line appended to a size-capped file in the common Git directory beside the commit timing records, and a debug line under MONOCHROMATIC_VERBOSE=true; the person’s terminal shows neither.

In TS you’d write (pseudocode):

await appendFile(join(commonDir, 'cli-git-push-trigger.jsonl'), JSON.stringify({ command, outcome, reason }) + '\n');

Enums§

Outcome
How the trigger ended for one command.

Constants§

TRIGGER_FILE
The file inside the common Git directory that collects the trigger records of every worktree of the repository.
TRIGGER_SCHEMA_VERSION
The version of the record’s fields; it changes only when a field’s meaning changes, never when a field is added.

Functions§

record_decision
What: Records one decision: a debug line always (when verbose), and one appended line when the common Git directory is known. Why: The command’s result never depends on the record: a file that cannot be written is only a debug line.
trigger_line
What: The line for one decision. Why: The fields say which command, which release, which branch and tips, and the one reason, so a missing push is diagnosed from the file alone.