From: Junio C Hamano Date: Fri, 27 Feb 2009 02:10:46 GMT Subject: Re: serious problem with `git format-patch' & `git am' Message-ID: <7viqmwpr2x.fsf@gitster.siamese.dyndns.org> In-Reply-To: Jakub Narebski writes: > I think you want undocumented but for the git-am usage (e.g. 'git am > -h') --rebasing option to git-am, which makes git-am preserve Subject: > line formatting,... I have to warn that that one requires you to have proper commit object to begin with. IOW, the first line "From [0-9a-f]{40} date" must record an existing object name. As you said, "am" is for applying e-mailed patches and filter-branch would be the best fit for fixing imported history, but whichever tool is used, I think it is a mistake to try preserving a "one-line-per-paragraph" format the original poster seems to have, i.e.: foo foo foo foo bar bar bar bar baz baz baz baz Yes, the low-level could create a commit object with a message like that, but all the Porcelains rely on "paragraphs are separated with a blank line" format. So no matter how the conversion is done, I think it would be a good idea to turn the above into: foo foo foo foo bar bar bar bar baz baz baz baz if the user wants to keep the resulting history any useful. To do it with "format-patch | am", you would format it like: Subject: foo foo foo foo From: author name Date: author date bar bar bar bar baz baz baz baz