git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How do we import patches from non-git sources?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
May 24, 2007, 21:45 UTC
Message-ID
<alpine.LFD.0.98.0705241439220.26602@woody.linux-foundation.org>
In-Reply-To
<1180017010.21181.2.camel@zealous.synapsedev.com>
On Thu, 24 May 2007, Marc Singer wrote:
> 
> Is there a way to import patches that did not come from git?  Remember
> that we'd like to include the functionality of git-am that adds new
> files to the index.
The normal thing to do is
	git apply --index <patchfile>

which will apply a patch _and_ update the index, so that you can then just do a simple

	git commit -m "my message goes here" --author "the author goes here"
to create the commit, new (or deleted) files and all.

Of course, the reason the "normal" patch format is an email, and not just a bare patch, is that an email contains so much more: it contains not just the patch, but the authorship information and the commit message.

So basically:
 - no, you _cannot_ just "commit" a patch, since a patch on its own 
   doesn't contain the required information to be a real commit.
 - but yes, you can obviously _apply_ a patch, and then commit it once you 
   add the proper information, but that does require more information than 
   just the patch itself includes.
So hopefully that clarified things.
		Linus
Previous: Jakub NarebskiNext: Marc Singer
Message 5 of 14 in “How do we import patches from non-git sources?”
  1. Marc SingerMay 24, 2007
  2. Johannes SchindelinMay 24, 2007
  3. Yann DirsonMay 24, 2007
  4. Jakub NarebskiMay 25, 2007
  5. Linus TorvaldsMay 24, 2007
  6. Let me ask again: How do we import patches from non-git sources?Marc Singer, Jun 6, 2007
  7. J. Bruce FieldsJun 6, 2007
  8. Marc SingerJun 12, 2007
  9. J. Bruce FieldsJun 12, 2007
  10. Marc SingerJun 14, 2007
  11. Matthieu MoyJun 6, 2007
  12. Jon LoeligerJun 6, 2007
  13. Marc SingerJun 14, 2007
  14. Matthieu MoyJun 14, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.