Skip to main content

Module service_commit_args

Module service_commit_args 

Source
Expand description

Which commit command lines the commit service covers, and the message they stand for. What: Which git commit command lines the resident service lands, and the message such a line stands for. Why: The service lands the scoped commit an agent or a person types most (git commit -m <message> -- <paths>), with the options that only shape the message or the identity: -F <file>, --author, --date, --trailer, --cleanup, --allow-empty-message, -s, --amend and --reset-author. Every other option (editor, signing, templates) still goes through the transaction until the service covers it, so this module answers “is this line one the service covers” before anything is prepared, and builds the message with the clean-up Git applies when no editor opens.

In TS you’d write (pseudocode):

const parsed = parseServiceCommit(args); // undefined when the line needs native git commit

Structs§

ServiceCommitArgs
What a covered command line asked for.

Enums§

FixupKind
Which message prefix --fixup and --squash make.

Functions§

cleanup_message
What: The commit message Git makes of the given texts when no editor opens. Why: Each text is a paragraph; Git strips trailing whitespace from every line, drops leading and trailing blank lines, squeezes runs of blank lines into one and ends the message with a newline. An empty result is no message.
opens_editor
What: Whether git commit with these arguments may open an editor. Why: The answer decides what happens to a commit Git built when the branch moved meanwhile: with no editor it is built again on the new tip, with an editor the typed message is saved for the person instead of being lost. It errs towards “may open”: an option this reading does not know, or a spelling Git accepts as an abbreviation, counts as an editor, because a message saved without need costs nothing and a message lost costs the person’s typing.
parse_service_commit
What: Reads the arguments after commit and says whether the service covers them. Why: Anything not listed here is refused, so a new Git option is never silently dropped.