Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Editing .patch files?

Re: Editing .patch files?

From: Jerry Van Baren <gerald.vanbaren_at_smiths-aerospace.com>
Date: 2006-02-24

gl wrote:
>
> 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?
> --
> gl

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.

Example:
@@ -26,6 +26,8 @@

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.

gvb
Received on Fri Feb 24 18:06:52 2006


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa