Re: In-body from headers ignored

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Liam Breck <liam@xxxxxxxxxxxxxxxxx> writes:

> git format-patch & send-email generate the in-body From header.
>
> git am recognizes it.
>
> git commit & format-patch & send-email ignore it. (The latter two will
> add a new header above an extant one.) Is there a rationale for this?

I may be misunderstanding you, but I am guessing that you are
expecting

	$ GIT_AUTHOR_NAME="Liam Breck" GIT_AUTHOR_EMAIL='liam@xxxxx' \
	git commit -m 'The title of the patch

	From: Somebody Else <somebody@xxxxxxx>
	Subject: The real title of the patch

	This is the (true) first line of the body of the message.'

to record a commit object that would give

	$ git cat-file commit HEAD
	tree ....
	parent ....
	author Somebody Else <somebody@xxxxxxx> ....
	committer ...

	The real title of the patch

	This is the (true) first line of the body of the message.

and seeing that the real author is still you, the title is "The real
title of the patch", and the first paragraph of the body consists of
these two lines that begin with "From: and "Subject:".

This is very much deliberate.  "git commit" does not care if the
second paragraph in the body of the message resembles e-mail
headers, because it is a command that can be used by people who do
not even e-mail patches.

"git format-patch" and "git am" are all about passing the commit
between people over e-mail, and they know that the second paragraph
can have "From:", "Subject:" or "Date:" to override what "am"
obtains from the header lines of the e-mail that carried the
message, because the e-mail headers can be different (e.g. you may
be forwarding somebody else's e-mail but you may not be able to
forge the real "From:" line to your MUA/MTA) from what you really
want to use.  On the receiving end, "am" tells "mailinfo" program to
inspect the message body with "--inbody-headers" option.  After
"mailinfo" inspects the message, "am" invokes the underlying
machinery to actually make the commit (which corresponds to "git
commit"), but at that point the invoked "git commit" does not even
see these in-body header lines.  That is how division of labor
between these layers of the commands are structured.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]