From: Junio C Hamano Date: Fri, 09 Nov 2007 01:51:59 GMT Subject: Re: [BUG] git-rebase fails when a commit message contains a diff Message-ID: <7vhcjwxk1s.fsf@gitster.siamese.dyndns.org> In-Reply-To: <7vlk98xkm3.fsf@gitster.siamese.dyndns.org> Junio C Hamano writes: > That's a known design limitation of applymbox/mailinfo. Any > line that looks like a beginning of a patch in e-mail ("^--- ", > "^---$", "^diff -", and "^Index: ") terminates the commit log. Ok, so that explains the symptom. What's the next step? * The applymbox/mailinfo pair should continue to split the commit log message at the first such line. There is no point breaking established workflow, and people in communities that exchange patches via e-mail already know to avoid this issue by indenting quoted diff snippet in the log message, e.g. 5be507fc. * There is no fundamental reason for rebase to use e-mail format to express what "format-patch | am -3" pipeline does. We do it currently because (1) it was expedient to reuse what was already there, and because (2) the original target audience of git are e-mail oriented communities, so there was not strong incentive to make rebase independent of the applymbox/mailinfo limitation (that is, even if you make rebase able to handle such a patch, you cannot send out the result over e-mail *anyway*). This however does not mean we should always use merging rebase. patch based approach "format-patch | am -3" pipeline uses is often much faster. Instead of using "format-patch | am -3", we could use more careful patch and message generation, like git-rebase--interactive.sh:make_patch() does.