Subject: Re: Re* [GIT PULL] sh updates for 2.6.25

From: Jakub Narebski <[email-masked]>
Date: Wed, 16 Apr 2008 22:22:18 +0200

Junio C Hamano wrote:
[cut]

> So in short, when you use "am", it by design unfolds the "Subject: " line
> and there is no bug there.  "rebase" being implemented in terms of
> "format-patch piped to am" does mangle the message because of this, but
> if anything that is a bug in rebase, and not "am".
> 
> And this is a potential fix to the issue, which was made possible only
> because recently "rebase" started passing an extra option to "am".
> 
> -- >8 --
> From: Junio C Hamano <[email-masked]>
> Date: Wed, 16 Apr 2008 12:50:48 -0700
> Subject: [PATCH] rebase: do not munge commit log message
> 
> Traditionally git-rebase was implemented in terms of "format-patch" piped
> to "am -3", to strike balance between speed (because it avoids a rather
> expensive read-tree/merge-recursive machinery most of the time) and
> flexibility (the magic "-3" allows it to fall back to 3-way merge as
> necessary).  However, this combination has one flaw when dealing with a
> nonstandard commit log message format that has more than one lines in the
> first paragraph, because such a "first line" is formatted as logically a
> single line, and unfolded at the applying end.
> 
> This teaches "git am --rebasing" to take advantage of the fact that the
> mbox message "git rebase" prepares for it records the original commit
> object name, and that such a commit _is_ available locally.  It reads the
> log message from the original commit object instead.

IIRC there was alternate patch which made git-format-patch to add extra
email header meant for git-am to "obey the (encoded) commit message
formatting."

But this solution is simpler, and I think better.

-- 
Jakub Narebski
Poland