<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>Keith's Web Blog RSS Feed</title>
<language>en-us</language>
<link>http://www.keithwatanabe.net/index.php</link>
<description>Keith Watanabe's Website</description>
<item>
<title>Subversion and Patch</title>
<link>http://www.keithwatanabe.net/blogs/2008/1/28/cfe181ec2bae0e8094aebc7d208f3e93.html</link>
<description><![CDATA[The next point of advancement in my skill elevation has been learning the <strong>patch</strong> utility.  Actually, I got to work with a combination of the unix utilities <strong>diff</strong> and <strong>patch</strong>.  I've found various <a href="http://www.linuxtutorialblog.com/post/introduction-using-diff-and-patch-tutorial">good tutorials</a> on the subject to get me started.  Right now, I'm doing some simple patch creation.  In the easiest form, you can create a patch from two files using diff like this:<br />
<br />
<strong>diff</strong> -c <em>original_file</em> <em>new_file</em> &gt; <em>patch.diff</em><br />
<br />
Apparently, the &quot;-c&quot; options allows for some context based mode that will allow the patch program to have an easier time patching your code.  Also, the order of running the diff is critical.  If you do this in the wrong order, patch will just give you a warning message and create a kind of backup file with the .orig extension.<br />
<br />
Using the patch file, you would do something like this:<br />
<br />
<strong>patch</strong> <em>original_file</em> -i <em>patch.diff</em><br />
<br />
The &quot;-i&quot; option tells patch the input file (i.e. the patch file).<br />
<br />
You can also diff directories in creating a patch.  I didn't succeed very well at that, but I'll put up my results once I become an expert in that area.<br />
<br />
With <strong>Subversion</strong>, you can perform even more powerful patches by using Subversion's diff utility and comparing the repository items against a file or even directories.  I had some issues getting this to work, but I think my biggest issue was the ordering of the diff.  I kept getting the .orig extensions, signifying that patch did not work as expected.  Well, I'll try again another day as I really want to become an expert at these subject matters.<br />
<br />
On a side note, it's a real bitch mastering so many different technologies.  You learn one tool, then you find out that you have to learn around 10 more related ones.  On a positive note, I'm getting to the point where I feel very comfortable with a large number of tools.  These are just another feather in my cap.]]></description>
<pubDate>Mon, 28 Jan 2008 06:55:36 -0700</pubDate>
<guid>http://www.keithwatanabe.net/blogs/2008/1/28/cfe181ec2bae0e8094aebc7d208f3e93.html</guid>
</item>
</channel>
</rss>
