
On 2012-06-10 13:45, Russell Coker wrote:
I have to deal with some very long patches that have many sections that are of interest. What I need is a tool that allows basic regular expressions to search and which then gets every file that matches. IE if a patch changed files a.c, b.c, and c.c and I did a search for printf then I would want patches for the files which have changes related to printf and have the changes include all sections for each file in question.
Failing that does anyone know of a tool to split a large patch into one separate patch for each file that is patched? EG a patch would be split into a.c.diff, b.c.diff, and c.c.diff? Once a patch was split like that I could use some shell code that involves grep and rm to get the patches I really want.
A quick google search gets lots of hits for "patch" and "grep" which are not related to what I want to do. I might write a little Perl program to implement the latter, but the former would be a good thing to have.
If I had to do something like this I think I'd create a git repository of the original codebase, make a commit, apply patch, make another commit, and then use git to search for changes. I don't know if this is suitable for you, but it's the easiest thing I can think of. -- Regards, Matthew Cengia