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

Re: splitting large patch files into smaller ones

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Aug 22, 2007, 21:54 UTC
Message-ID
<46CCB07C.9010200@lsrfire.ath.cx>
In-Reply-To
<200708221929.l7MJTgiL012452@agora.fsl.cs.sunysb.edu>
Erez Zadok schrieb:
Show 16 quoted lines
> I recently had an occasion to take a rather large git-diff patch, and split
> it into smaller chunks.  This was so I can more easily import the patches
> into guilt, then reorder, rename, shuffle, and join individual patch
> snippets into logical patches (i.e., one patch per topic).
> 
> I was looking around for a tool that would allow me to split a large patch
> file into individual snippets and couldn't find one.  So I wrote one in
> perl.  It takes a patch file and creates individual small files, one for
> each combination of a filename listed in the patch, and a patch snippet
> (starting with an '@@' line).  Each '@@' snippet gets an index number and a
> new filename, prefixed with the appropriate header ("diff ...", ---, and +++
> lines) so it's a valid patch file on its own.
> 
> Questions:
> 
> 1. Does anyone know of such a tool, perhaps written in C for better speed?

The patchutils collection[1] contains a tool called splitdiff, which does something slightly different[2]. It might be a good starting point, though.

René

[1] http://cyberelk.net/tim/software/patchutils/?page_id=10 [2] http://cyberelk.net/tim/patchutils/man/splitdiff.html

Previous: Erez ZadokNext: Johannes Schindelin
Message 2 of 3 in “splitting large patch files into smaller ones”
  1. Erez ZadokAug 22, 2007
  2. René ScharfeAug 22, 2007
  3. Johannes SchindelinAug 23, 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.