Re: Let me ask again: How do we import patches from non-git sources?
From: J. Bruce Fields <hidden>
Date: 2016-06-15 22:43:15
On Tue, Jun 12, 2007 at 09:27:33AM -0700, Marc Singer wrote:
On Wed, 2007-06-06 at 13:54 -0400, J. Bruce Fields wrote:quoted
Based on my notes from the last time I needed to feed a bunch of non-mbox, non-git-produced patches into git-am, the hard part was figuring out how it split a file into separate messages; my notes say: "Finds lines begining with "From " and ending with "hh:mm:ss yyyy". See builtin-mailsplit code for more details." Other than that, I think it just needs and From: and Subject: lines to get author and first-line of the commit. the git-am man page has some documentation of this. It could probably use more.I'm not sure that I understand your response. git-am complains that it cannot find an email address, but raw patches seldom have these. So, either we could use another command, or it would be handy if we could supply the email address to git-am (or some other data it needs so that it can split the patch.) I suppose the mistaken assumption is that the patch source in an email instead of already being a nice clean patch.
I think it's intentional. You need some standard format git-am can use to split out the patches and find the comments and the authorship information (for the Author: field on the commit), so why not just use something like mbox? And it could provide some fallback for the "Author:" information in the case where it didn't find that, but we wouldn't want that to be the default if it meant risking silently losing authorship information. I suppose an "--author" option to git-am might be convenient sometimes. But personally I always just add those headers by hand (or with a script). It's not that hard; I the minimum required is just three lines, I think: From git-owner@vger.kernel.org Tue jun 12 11:43:40 2007 From: someone [off-list ref] Subject: [PATCH] do something Do something complicated. --- diff a/foo b/foo ... And often I need different authors on different patches anyway, so git-am --author wouldn't help. Of course if you've just got one patch to import, you can git-apply and then commit. --b. (PS: Standard practice around here is to leave people on the To: and/or Cc: lines when you reply, and for me at least that'd be easier.)