Rockbox mail archiveSubject: Re: Editing .patch files?
Re: Editing .patch files?
From: Jerry Van Baren <gerald.vanbaren_at_smiths-aerospace.com>
Date: Fri, 24 Feb 2006 12:06:13 -0500
> OK, I'm new to the world of diff and patch. I've added about 4 features
> to a CVS build (spread over many files), and want to create a .patch
> file for just one of them for submission.
> I can generate a total patch against CVS, but editing it to remove the
> mods I don't want is tricky where features overlap files, due to the way
> .patch files work. How does everybody else do this?
Hand editing the patch files is pretty simple, although can get confusing.
Each changed file has an obvious header. If you don't intend to change
that file, simply delete the section to the next file header.
Within a file, each change section has a flag showing the starting line
and number of lines that were removed in the section and then the
starting line and number of lines that were added.
_at__at_ -26,6 +26,8 _at__at_
The above example, starting at line 26 I "deleted" 6 lines and then
added 8 lines (actually, I changed 6 lines and then added 6 lines).
If the change is undesirable in the patch, simply delete the header and
following lines until the next header.
Where it gets confusing is when there are lots of changes or large
changes. You should create a hand-edited patch file and then apply it
to the unmodified source and verify that it goes in cleanly and does
what you intended.
Received on 2006-02-24