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

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

From
Yann Dirson <ydirson@altern.org>
Date
May 24, 2007, 21:22 UTC
Message-ID
<20070524212202.GW19253@nan92-1-81-57-214-146.fbx.proxad.net>
In-Reply-To
<1180017010.21181.2.camel@zealous.synapsedev.com>
On Thu, May 24, 2007 at 07:30:10AM -0700, 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.

I have written a patch-application tool as part of the (otherwise stalled) ArcheoloGIT project, clonable from http://ydirson.free.fr/soft/git/argit.git/.

Side note: it could make sense to finalize this script and integrate it in git proper. Opinions ?

Although the command-line interface would probably benefit from an overhaul, it is fully functionning, notably supporting:

- application of several patches in one row
- application of non-incremental patches - eg. the 2.4.19rmk2 patch
applies to plain 2.4.19, not to 2.4.19rmk1
| $ ../argit/ag-import-patch --help
| Usage: ag-import-patch ( [-v] [-n] [-b BASE|-i] [-N NAME] [-p PARENT]... [-t TAG] PATCH )*
| 
| Import a revision in a GIT history from a patch.
| Part of the ArcheoloGIT toolkit.
| Copyright (c) Yann Dirson, 2005
| Distributed under version 2 of the GNU GPL.
Since it lacks doc, here is it:
-i		- process subsequent paches as incremental (the default)
-b BASE		- process subsequent paches as applying to commit BASE
-N NAME 	- use given NAME instead of patch filename for generating
		  commit message (useful for /dev/stdin import)
-t TAG		- tag after import
-p PARENT	- add PARENT to the parents
eg:
$ git checkout v2.4.19
$ ag-import-patch -b v2.4.19 \
	-p v2.4.18rmk6 -t v2.4.19rmk1 patch-2.4.19rmk1.diff \
	-t v2.4.19rmk2 patch-2.4.19rmk2.diff 
Hope this helps,
-- 
Yann.
Previous: Johannes SchindelinNext: Jakub Narebski
Message 3 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.