<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Acelan's Life &#187; patch</title>
	<atom:link href="http://blog.acelan.idv.tw/tag/patch/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.acelan.idv.tw</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 07 Sep 2011 03:31:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Apply patch</title>
		<link>http://blog.acelan.idv.tw/2009/11/apply-patch/</link>
		<comments>http://blog.acelan.idv.tw/2009/11/apply-patch/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 03:47:53 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[zsh]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=47</guid>
		<description><![CDATA[PATCH=patch_filename ; git am $PATCH &#124;&#124; (git apply --reject $PATCH ; find -name *.rej)
It&#8217;s done, if no .rej files be produced.
If git am failed, it&#8217;ll try to apply the other successful part and produce the .rej files to indicate the failed part.
Edit the failed files then, and using git status to make sure how many [...]]]></description>
			<content:encoded><![CDATA[<p><code>PATCH=patch_filename ; git am $PATCH || (git apply --reject $PATCH ; find -name *.rej)</code></p>
<p>It&#8217;s done, if no .rej files be produced.</p>
<p>If <code>git am</code> failed, it&#8217;ll try to apply the other successful part and produce the .rej files to indicate the failed part.</p>
<p>Edit the failed files then, and using <code>git status</code> to make sure how many files infected and using <code>git add files</code> to add them or using <code> git add -u</code> to add all not updated files.</p>
<p>Finally, <code>git am --resolved</code></p>
<p>Note for the zsh user. (2010/01/12)<br />
I changed my default shell to zsh recently and found the apply patch command is broken. Although zsh claim that it&#8217;s compatible with bash, there are still some difference. But the good news is we can overcome this problem by adding one more line in the .zshrc<br />
<code>setopt GLOB_SUBST</code><br />
More detail, please read <a href="http://zsh.sourceforge.net/Guide/zshguide02.html#l14">this</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2009/11/apply-patch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

