git-mailinfo
Extract patch information from email messages
TLDR
Extract the patch and author data from an email message
Extract but remove leading and trailing whitespace
Remove everything from the body before a scissors line (e.g. "-->* --") and retrieve the message or patch
SYNOPSIS
git mailinfo <msg>
PARAMETERS
<msg>
The path to the mail message file to be parsed. This file typically contains one or more email messages or patch files formatted as standard emails.
DESCRIPTION
The git-mailinfo command is a Git plumbing command used to parse a mail message (e.g., an email or a patch file) and extract essential header information: the sender's identity, the message date, and the subject line.
It is primarily used internally by other Git commands, such as git-am, which utilizes it to construct commit messages when applying patches from a mailbox. It reads the mail message from the specified file and prints the extracted information to standard output in a structured format suitable for programmatic consumption.
While not typically invoked directly by end-users, it's a fundamental component in Git's mail-handling capabilities, ensuring consistent processing of email-based patches.
CAVEATS
git-mailinfo is a plumbing command, meaning it is designed for internal use by Git scripts and other Git commands. Its output format is stable but intended for programmatic parsing rather than direct human readability. It expects input in a standard mail message format and may not behave as expected with malformed or non-standard input.
HISTORY
git-mailinfo is an integral part of Git's mail-based patch workflow, a core feature of Git since its early development. It was developed to reliably parse and extract metadata from email-formatted patches, facilitating the `git-am` command's ability to apply patches from a mailbox. Its existence underscores Git's strong support for distributed workflows reliant on email-based communication and patch exchange.
SEE ALSO
git-am(1), git-format-patch(1), git-mailsplit(1), git-stripspace(1)