Skip to main content

Module service_message

Module service_message 

Source
Expand description

The message and identities of a service commit, made as native git commit makes them. What: The message and the identities of a commit the service lands, made from the command line the way native git commit makes them when no editor opens. Why: Everything here is text arithmetic that Git itself defines (clean-up, sign-off, trailers, the subject of a fixup, the message and authorship of a reused commit), so the wrapper embeds it instead of starting git commit; each rule is compared field by field with the native commit in binary_service_options_tests.rs. Whatever cannot be made without guessing returns nothing and native git commit handles the line.

In TS you’d write (pseudocode):

const { message, author } = await buildMessage(invocation, parsed, committer);

Structs§

Built
What a command line’s message came to.

Functions§

author_overrides
The author variables --author and --date stand for.
build_message
What: The message the command line stands for: -m texts, the -F file, the message of the -C commit or the subject line of a fixup (or, for an amend with no message option, the message of the commit it replaces), cleaned as Git cleans it when no editor opens (or kept as given for --cleanup=verbatim), then given the sign-off and the --trailer lines by Git’s own trailer interpreter. Why: Nothing here guesses: an empty message without --allow-empty-message, an unreadable file, a commit Git cannot resolve or a trailer Git refuses returns nothing, and native git commit then gives the person its own message.
identity
One identity line (Name <email> seconds zone) from Git’s own resolution of the variable, with the given overrides; nothing when Git cannot make one (a date it does not read), so native git commit gives its own message.
strip_comment_lines
The lines of a message without those that start with the comment character, as --cleanup=strip drops them.