{"thread":{"id":"9615","subject":"splitting large patch files into smaller ones","startedAt":"2007-08-22T19:29:42Z","lastAt":"2007-08-23T09:43:41Z","messageCount":3,"participants":["Erez Zadok","René Scharfe","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"51282","messageId":"200708221929.l7MJTgiL012452@agora.fsl.cs.sunysb.edu","threadId":"9615","inReplyTo":null,"subject":"splitting large patch files into smaller ones","fromName":"Erez Zadok","fromEmail":"ezk@cs.sunysb.edu","sentAt":"2007-08-22T19:29:42Z","receivedAt":"2007-08-22T19:29:42Z","isPatch":false,"sender":{"key":"ezk@cs.sunysb.edu","avatar":null},"body":"I recently had an occasion to take a rather large git-diff patch, and split\nit into smaller chunks.  This was so I can more easily import the patches\ninto guilt, then reorder, rename, shuffle, and join individual patch\nsnippets into logical patches (i.e., one patch per topic).\n\nI was looking around for a tool that would allow me to split a large patch\nfile into individual snippets and couldn't find one.  So I wrote one in\nperl.  It takes a patch file and creates individual small files, one for\neach combination of a filename listed in the patch, and a patch snippet\n(starting with an '@@' line).  Each '@@' snippet gets an index number and a\nnew filename, prefixed with the appropriate header (\"diff ...\", ---, and +++\nlines) so it's a valid patch file on its own.\n\nQuestions:\n\n1. Does anyone know of such a tool, perhaps written in C for better speed?\n\n2. If not, is there any interest in such a tool?  If there's interest, I'd\n   be happy to cleanup my perl script and contribute it to\n   git/guilt/whatever.\n\nCheers,\nErez.\n"},{"id":"51296","messageId":"46CCB07C.9010200@lsrfire.ath.cx","threadId":"9615","inReplyTo":"200708221929.l7MJTgiL012452@agora.fsl.cs.sunysb.edu","subject":"Re: splitting large patch files into smaller ones","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2007-08-22T21:54:04Z","receivedAt":"2007-08-22T21:54:04Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Erez Zadok schrieb:\n> I recently had an occasion to take a rather large git-diff patch, and split\n> it into smaller chunks.  This was so I can more easily import the patches\n> into guilt, then reorder, rename, shuffle, and join individual patch\n> snippets into logical patches (i.e., one patch per topic).\n> \n> I was looking around for a tool that would allow me to split a large patch\n> file into individual snippets and couldn't find one.  So I wrote one in\n> perl.  It takes a patch file and creates individual small files, one for\n> each combination of a filename listed in the patch, and a patch snippet\n> (starting with an '@@' line).  Each '@@' snippet gets an index number and a\n> new filename, prefixed with the appropriate header (\"diff ...\", ---, and +++\n> lines) so it's a valid patch file on its own.\n> \n> Questions:\n> \n> 1. Does anyone know of such a tool, perhaps written in C for better speed?\n\nThe patchutils collection[1] contains a tool called splitdiff, which\ndoes something slightly different[2].  It might be a good starting\npoint, though.\n\nRené\n\n\n[1] http://cyberelk.net/tim/software/patchutils/?page_id=10\n[2] http://cyberelk.net/tim/patchutils/man/splitdiff.html\n"},{"id":"51356","messageId":"Pine.LNX.4.64.0708231042120.20400@racer.site","threadId":"9615","inReplyTo":"200708221929.l7MJTgiL012452@agora.fsl.cs.sunysb.edu","subject":"Re: splitting large patch files into smaller ones","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-23T09:43:41Z","receivedAt":"2007-08-23T09:43:41Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 22 Aug 2007, Erez Zadok wrote:\n\n> I was looking around for a tool that would allow me to split a large \n> patch file into individual snippets and couldn't find one.  So I wrote \n> one in perl.  It takes a patch file and creates individual small files, \n> one for each combination of a filename listed in the patch, and a patch \n> snippet (starting with an '@@' line).  Each '@@' snippet gets an index \n> number and a new filename, prefixed with the appropriate header (\"diff \n> ...\", ---, and +++ lines) so it's a valid patch file on its own.\n\nYou can do that with \"git add -i\" and with \"git gui\" AFAIK.  I even \nstarted some code to split hunks in \"git gui\", but it was pointed out that \nthat code was not complete, and I did not have time to finish it.\n\nCiao,\nDscho\n"}]}