
I have a diff file that has changes to multiple source files that I want to split up for sending upstream. Is there a good tool for splitting this? The ideal would be something that takes a list of source files on the command line, and writes the diffs for them to one file and the diffs for everything else to another. -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/

Quoting Russell Coker (russell@coker.com.au):
I have a diff file that has changes to multiple source files that I want to split up for sending upstream. Is there a good tool for splitting this?
The ideal would be something that takes a list of source files on the command line, and writes the diffs for them to one file and the diffs for everything else to another.
splitdiff(1) divides single unified diff into individual diffs for each of the affected files combinediff(1) can do the reverse operation. http://linuxcommand.org/man_pages/splitdiff1.html Hope that helps!

On Wed, 22 Feb 2017 05:14:10 PM Rick Moen via luv-main wrote:
Quoting Russell Coker (russell@coker.com.au):
I have a diff file that has changes to multiple source files that I want to split up for sending upstream. Is there a good tool for splitting this?
The ideal would be something that takes a list of source files on the command line, and writes the diffs for them to one file and the diffs for everything else to another.
splitdiff(1) divides single unified diff into individual diffs for each of the affected files
combinediff(1) can do the reverse operation.
Thanks for that. The man page is a little confusing, it doesn't mention that the program seems to do nothing unless you use -a. Also it doesn't handle the Index and ==== lines that Quilt generates. Fortunately you can just grep those out and Quilt will generate new ones next time you run "quilt refresh". I didn't try combinediff, cat did the job. On Wed, 22 Feb 2017 05:20:46 PM Brian May via luv-main wrote:
Maybe filterdiff from the patchutils Debian package?
Thanks for the suggestion, but it turned out that splitdiff did what I needed quickly enough that I didn't even get to try it. It's something to consider for future use though. -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/

Russell Coker via luv-main <luv-main@luv.asn.au> writes:
I have a diff file that has changes to multiple source files that I want to split up for sending upstream. Is there a good tool for splitting this?
The ideal would be something that takes a list of source files on the command line, and writes the diffs for them to one file and the diffs for everything else to another.
Maybe filterdiff from the patchutils Debian package? -- Brian May <brian@linuxpenguins.xyz> https://linuxpenguins.xyz/brian/
participants (3)
-
Brian May
-
Rick Moen
-
Russell Coker