Git
简体中文 ▾ Topics ▾ Latest version ▾ git-mailinfo last updated in 2.43.2

名称

git-mailinfo - 从单个电子邮件信息中提取补丁和作者

概述

git mailinfo [-k|-b] [-u | --encoding=<编码> | -n]
	       [--[no-]scissors] [--quoted-cr=<行为>]
	       <消息> <补丁>

描述

Reads a single e-mail message from the standard input, and writes the commit log message in <msg> file, and the patches in <patch> file. The author name, e-mail and e-mail subject are written out to the standard output to be used by git am to create a commit. It is usually not necessary to use this command directly. See git-am[1] instead.

选项

-k

Usually the program removes email cruft from the Subject: header line to extract the title line for the commit log message. This option prevents this munging, and is most useful when used to read back git format-patch -k output.

具体来说,以下内容会被删除,直到一个都不剩:

  • 前导和尾部的多余空白字符。

  • 前导的的 Re:re:,和 :

  • 前导括号内的字符串(在 [] 之间,通常是 [PATCH])。

最后,空格被规范化为一个ASCII空格字符。

-b

When -k is not in effect, all leading strings bracketed with [ and ] pairs are stripped. This option limits the stripping to only the pairs whose bracketed string contains the word "PATCH".

-u

The commit log message, author name and author email are taken from the e-mail, and after minimally decoding MIME transfer encoding, re-coded in the charset specified by i18n.commitEncoding (defaulting to UTF-8) by transliterating them. This used to be optional but now it is the default.

注意,即使有这个标志,补丁也总是按原样使用,不进行字符集转换。

--encoding=<编码>

Similar to -u. But when re-coding, the charset specified here is used instead of the one specified by i18n.commitEncoding or UTF-8.

-n

禁用元数据的所有字符集重新编码。

-m
--message-id

Copy the Message-ID header at the end of the commit message. This is useful in order to associate commits with mailing list discussions.

--scissors

Remove everything in body before a scissors line (e.g. "-- >8 --"). The line represents scissors and perforation marks, and is used to request the reader to cut the message at that line. If that line appears in the body of the message before the patch, everything before it (including the scissors line itself) is ignored when this option is used.

如果你想在讨论线中开始你的信息,对你所回应的信息提出评论和建议,并以提交补丁作为结束,用剪刀线把讨论和建议的提交日志信息的开头分开,这很有用。

这可以通过配置选项 mailinfo.scissors 来默认启用。

--no-scissors

忽略剪切线。对于覆盖 mailinfo.scissors 设置很有用。

--quoted-cr=<行为>

当处理以 base64 或 quoted-printable 编码发送的电子邮件,并且解码后的行以 CRLF 而不是简单的 LF 结尾时,就会启用。

有效的行为是:

  • nowarn: 当发现这样的 CRLF 时,Git将不做任何事情。

  • warn: 如果有这样的 CRLF,Git 会对每条信息发出警告 找到了。

  • strip: Git 将把这些 CRLF 转换为 LF。

The default action could be set by configuration option mailinfo.quotedCR. If no such configuration option has been set, warn will be used.

<消息>

从电子邮件中提取的提交日志信息,通常除了来自电子邮件主题的标题行。

<补丁>

从电子邮件中提取的补丁。

配置

Warning

Missing zh_HANS-CN/includes/cmd-config-section-all.txt

See original version for this content.

Warning

Missing zh_HANS-CN/config/mailinfo.txt

See original version for this content.

GIT

属于 git[1] 文档

scroll-to-top