<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://elinux.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://elinux.org/index.php?title=Handling_Patch_Rejects&amp;feed=atom&amp;action=history</id>
		<title>Handling Patch Rejects - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://elinux.org/index.php?title=Handling_Patch_Rejects&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=Handling_Patch_Rejects&amp;action=history"/>
		<updated>2013-05-24T14:32:25Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.22alpha</generator>

	<entry>
		<id>http://elinux.org/index.php?title=Handling_Patch_Rejects&amp;diff=2771&amp;oldid=prev</id>
		<title>TimBird: add stuff about finding and editing rejects</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=Handling_Patch_Rejects&amp;diff=2771&amp;oldid=prev"/>
				<updated>2007-04-26T20:05:58Z</updated>
		
		<summary type="html">&lt;p&gt;add stuff about finding and editing rejects&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 20:05, 26 April 2007&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 131:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 131:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;earlier).&amp;#160; Mandrake users may appreciate having such a&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;earlier).&amp;#160; Mandrake users may appreciate having such a&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;quot;Mandrake-tiny&amp;quot; patch set to work with.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;quot;Mandrake-tiny&amp;quot; patch set to work with.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Some more notes ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If you do this regularly, here are a few tips for working through rejects quickly.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;To find reject files in a source tree, at the top of the source tree type:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; find . -name &amp;quot;*.rej&amp;quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If you find a reject file, it is often useful to examine the reject file and edit the&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;file it applies to, simultaneously.&amp;#160; You can do this using shell wildcards pretty easily.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;For example, if you see the reject &amp;lt;tt&amp;gt;arch/arm/kernel/time.c.rej&amp;lt;/tt&amp;gt;, you can edit both&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;the reject file and the original file with:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; vi arch/arm/kernel/time.c*&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Now split your 'vi' window with &amp;quot;:split&amp;quot;, get the reject file in one of the windows, and&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;go through it and the original file fixing any problems found.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>TimBird</name></author>	</entry>

	<entry>
		<id>http://elinux.org/index.php?title=Handling_Patch_Rejects&amp;diff=1990&amp;oldid=prev</id>
		<title>RBot: Bot (Edward's framework)</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=Handling_Patch_Rejects&amp;diff=1990&amp;oldid=prev"/>
				<updated>2007-03-06T03:33:27Z</updated>
		
		<summary type="html">&lt;p&gt;Bot (Edward&amp;#039;s framework)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Here is the response I sent to someone on the Linux-tiny mailing list&lt;br /&gt;
when they had a question about how to handle reject files.&lt;br /&gt;
&lt;br /&gt;
This is for very new beginners.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Fernando de Francisco Cano wrote:&lt;br /&gt;
&amp;gt; Sure I have some rejects, but I don't know what to do with them....&lt;br /&gt;
&amp;gt; Until now I 've only recompiled distro kernels, so it's my first time&lt;br /&gt;
&amp;gt; patching&lt;br /&gt;
&amp;gt; &lt;br /&gt;
&amp;gt; Is there any problem patching  mandrake 10.0?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OK.  If you're new to patching, maybe a brief explanation is needed.&lt;br /&gt;
Pardon me if this is too remedial, but I wanted to write low level&lt;br /&gt;
since I don't know your experience.  Sorry in advance for the length.&lt;br /&gt;
&lt;br /&gt;
Patches are created by diff'ing two source bases against each other.&lt;br /&gt;
A patch is like a set of instructions for converting one source&lt;br /&gt;
base into the other.  Inside the patch are both the changes themselves,&lt;br /&gt;
and context information which helps patch to identify the correct&lt;br /&gt;
place to make each change.&lt;br /&gt;
&lt;br /&gt;
If you try to apply a patch to a different version of software than&lt;br /&gt;
it was originally created from, you may encounter problems.  Patch&lt;br /&gt;
may not find the correct place to make a change.  When this happens, &lt;br /&gt;
it leaves a reject file, showing the change that it could not &lt;br /&gt;
make.&lt;br /&gt;
&lt;br /&gt;
The Linux-tiny patches were created based on a kernel.org version&lt;br /&gt;
of Linux (I'm not sure which one you are using, so I don't know&lt;br /&gt;
the specific version).  The Mandake kernel (and indeed almost&lt;br /&gt;
all kernels shipped by the major Linux distribution vendors)&lt;br /&gt;
is significantly different from the kernel.org version of Linux.&lt;br /&gt;
Distribution vendors add many (often hundreds) of patches to&lt;br /&gt;
their kernels, in order to provide extra features to their products.&lt;br /&gt;
This includes drivers, protocols, filesystems, and other enhancements.&lt;br /&gt;
&lt;br /&gt;
Since Linux-tiny is a fairly big patchset, it is very likely that there&lt;br /&gt;
will be overlap between some of the changes it makes and some of the&lt;br /&gt;
changes made by Mandrake.&lt;br /&gt;
&lt;br /&gt;
If you get rejects while patching, it means that not all of the patch&lt;br /&gt;
could apply.  It is possible that the rejects don't matter, but you&lt;br /&gt;
can't know that without looking at them.  Basically, any time you&lt;br /&gt;
get rejects you need to examine them and either 1) fix them or 2) decide&lt;br /&gt;
they can be ignored, before proceeding.&lt;br /&gt;
&lt;br /&gt;
Many times, rejects can be fixed pretty easily.  A common cause&lt;br /&gt;
of rejects is multiple additions to the beginning or end of something.&lt;br /&gt;
Often, in these cases, the changes themselves don't really interfere&lt;br /&gt;
with each other.  But the change in text from one patch causes the&lt;br /&gt;
patch program to be unable to match the context for a change from&lt;br /&gt;
another patch.&lt;br /&gt;
&lt;br /&gt;
For example, take the following text and patches.  Starting&lt;br /&gt;
with a simple text file describing a fish, there are two patches,&lt;br /&gt;
one of which adds stuff about a dog and one adds stuff about&lt;br /&gt;
a cat.  Semantically, these patches don't interfere with each&lt;br /&gt;
other, and there is no harm in applying both changes to the&lt;br /&gt;
file.  However, patch has problems with them.&lt;br /&gt;
&lt;br /&gt;
Text (file 'A'):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
I have a fish, named Charlie.&lt;br /&gt;
He swims in a fishbowl.&lt;br /&gt;
He doesn't eat much.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.patch:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;--- A   2004-10-21 10:49:53.547578239 -0700&lt;br /&gt;
+++ B   2004-10-21 10:50:40.395525796 -0700&lt;br /&gt;
@@ -1,3 +1,5 @@&lt;br /&gt;
 I have a fish, named Charlie.&lt;br /&gt;
 He swims in a fishbowl.&lt;br /&gt;
 He doesn't eat much.&lt;br /&gt;
+My dog is named Spot.&lt;br /&gt;
+Spot is friendly and wags his tail.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.patch:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;--- A   2004-10-21 10:49:53.547578239 -0700&lt;br /&gt;
+++ C   2004-10-21 10:51:05.435687319 -0700&lt;br /&gt;
@@ -1,3 +1,5 @@&lt;br /&gt;
 I have a fish, named Charlie.&lt;br /&gt;
 He swims in a fishbowl.&lt;br /&gt;
 He doesn't eat much.&lt;br /&gt;
+My cat is named cleo.&lt;br /&gt;
+Cleo scratches the couch.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Each of these patches could be applied succesfully to&lt;br /&gt;
file A, individually.  However, if you try to apply these&lt;br /&gt;
patches in sequence, like so:&lt;br /&gt;
* cp A D&lt;br /&gt;
* patch D &amp;lt;1.patch&lt;br /&gt;
* patch D &amp;lt;2.patch&lt;br /&gt;
&lt;br /&gt;
You get a reject on the second patch. The place where the&lt;br /&gt;
description of the cat is supposed to be is now different,&lt;br /&gt;
and patch gives up.&lt;br /&gt;
&lt;br /&gt;
To fix this, you need to add the rejected changes manually,&lt;br /&gt;
taking into account the differences caused by the other changes. &lt;br /&gt;
(Think of 1.patch as the Mandrake changes and 2.patch as&lt;br /&gt;
the linux-tiny patch set.)&lt;br /&gt;
&lt;br /&gt;
Doing this is usually pretty easy.  You look at the rejected&lt;br /&gt;
hunks, and compare the lines they intended to patch from the&lt;br /&gt;
original file with the lines in your source base.&lt;br /&gt;
(In your case, compare a kernel.org version of Linux, with&lt;br /&gt;
Mandrake Linux, for the file and lines mentioned in the reject&lt;br /&gt;
file.)  In the example above, I would have to decide&lt;br /&gt;
if I wanted the description of the dog to come before or&lt;br /&gt;
after the description of the cat.  I would make the change&lt;br /&gt;
manually.  (If this were source, I would then recompile&lt;br /&gt;
and test extensively... :)&lt;br /&gt;
&lt;br /&gt;
For extra credit, once you have made your changes, you can &lt;br /&gt;
create a new linux-tiny patch set by diffing your Mandrake-tiny&lt;br /&gt;
with your original Mandrake (which you should have saved off&lt;br /&gt;
earlier).  Mandrake users may appreciate having such a&lt;br /&gt;
&amp;quot;Mandrake-tiny&amp;quot; patch set to work with.&lt;/div&gt;</summary>
		<author><name>RBot</name></author>	</entry>

	</feed>