<?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>jjgod / blog &#187; git</title>
	<atom:link href="http://blog.jjgod.org/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jjgod.org</link>
	<description>Random notes by Jjgod Jiang.</description>
	<lastBuildDate>Sat, 07 Aug 2010 08:08:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to test a proxy autoconfiguration file</title>
		<link>http://blog.jjgod.org/2009/01/29/how-to-test-a-proxy-pac/</link>
		<comments>http://blog.jjgod.org/2009/01/29/how-to-test-a-proxy-pac/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 05:38:48 +0000</pubDate>
		<dc:creator>jjgod</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[DOM | Scripting]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[gfw]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[pac]]></category>

		<guid isPermaLink="false">http://blog.jjgod.org/?p=348</guid>
		<description><![CDATA[Due to the existence of Greal Firewall, I have a terribly long proxy.pac file. Apparently, how to maintain that becomes a problem. Regularly, I use git to keep a &#8220;stable&#8221; version and make updates on it. Recently I just found the script stop working for no good reason, because the proxy server I&#8217;m using is [...]]]></description>
			<content:encoded><![CDATA[<p>Due to the existence of <a href="en.wikipedia.org/wiki/Golden_Shield_Project">Greal Firewall</a>, I have a terribly long <code>proxy.pac</code> file. Apparently, how to maintain that becomes a problem. Regularly, I use <a href="http://git-scm.com">git</a> to keep a &#8220;stable&#8221; version and make updates on it.</p>

<p>Recently I just found the script stop working for no good reason, because the proxy server I&#8217;m using is working, and I tried manually choose a proxy server (by entering its address and port into my browser directly) it also worked, so apparently there is something wrong with the script.</p>

<p>However, it has been a while since I last commit my changes to this script back to git. So there are some changes I wish to keep and I don&#8217;t want to do a binary search to find out the problem (Yep, I&#8217;m a lazy guy).</p>

<p>A few googling got me a tool called <a href="http://code.google.com/p/pactester/">pactester</a>, which turned out to be very useful. Basically it&#8217;s a Perl wrap of <a href="http://www.mozilla.org/js/spidermonkey">SpiderMonkey</a> JavaScript engine. Since the proxy autoconfiguration script is just a subset of plain JavaScript, it can safely executes that with SpiderMonkey and find out where is the problem.</p>

<p>So I installed it and did one test:</p>

<pre><code>$ pactester -p ~/Documents/Miscs/proxy.pac -u 'http://blog.iphone-dev.org'
Use of uninitialized value in numeric ne (!=) at pactester line 137.
Error: SyntaxError: missing ) after condition at line 98:
     if (dnsDomainIs(host, "cubes.fr") return "SOCKS 127.0.0.1:7777";
</code></pre>

<p>So that&#8217;s the problem. Fixed it, everything is back to normal again!</p>

<p>That&#8217;s a small tip on debugging a complex pac script, hope it helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjgod.org/2009/01/29/how-to-test-a-proxy-pac/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>又土鳖了一把</title>
		<link>http://blog.jjgod.org/2008/03/17/mozilla-cvs-git/</link>
		<comments>http://blog.jjgod.org/2008/03/17/mozilla-cvs-git/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 18:27:02 +0000</pubDate>
		<dc:creator>jjgod</dc:creator>
				<category><![CDATA[Miscs]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[cvs]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[patch]]></category>

		<guid isPermaLink="false">http://blog.jjgod.org/2008/03/17/mozilla-cvs-git/</guid>
		<description><![CDATA[更新: gitmo 已经过期了，Sergey Yanovich 更新了 git repo 上的说明，现在应该用这个 client.sh 来更新。 今天实在是受不了 CVS 了：在 mozilla 这么大的树上用 cvs diff 简直是自虐，于是找来 mozilla cvs trunk 的 git mirror 来 clone，上次 clone 过一次发现缺东西不能编译，因为 mozilla cvs 树里有些东西是作为 external item 放在别的地方的，比如 nsprpub，但 git mirror (和 hg mirror) 都没有镜像这些。 因为看 mozilla.dev.platform 上有人贴了一个 gitmo 的脚本还方便，以为不会出问题的，结果还是出问题了。 为什么呢？因为 git 的 mirror 是用那个 repository 的几个 branch 来存这些 [...]]]></description>
			<content:encoded><![CDATA[<p><strong>更新</strong>: <a href="http://www.aasii.org/download/gitmo">gitmo</a> 已经过期了，Sergey Yanovich 更新了 <a href="http://repo.or.cz/w/mozilla-1.9.git">git repo</a> 上的说明，现在应该用这个 <a href="http://www.aasii.org/download/client.sh">client.sh</a> 来更新。</p>

<p>今天实在是受不了 CVS 了：在 mozilla 这么大的树上用 cvs diff 简直是自虐，于是找来 mozilla cvs trunk 的 <a href="http://repo.or.cz/w/mozilla-1.9.git/">git mirror</a> 来 clone，上次 clone 过一次发现缺东西不能编译，因为 mozilla cvs 树里有些东西是作为 external item 放在别的地方的，比如 nsprpub，但 git mirror (和 <a href="http://hg.mozilla.org/cvs-trunk-mirror">hg mirror</a>) 都没有镜像这些。</p>

<p>因为看 <a href="http://groups.google.com/group/mozilla.dev.platform">mozilla.dev.platform</a> 上<a href="http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/8918d92bd3ba7694">有人贴了</a>一个 <a href="http://www.aasii.org/download/gitmo">gitmo</a> 的脚本还方便，以为不会出问题的，结果还是出问题了。</p>

<p>为什么呢？因为 git 的 mirror 是用那个 repository 的几个 branch 来存这些 external items 的，每次我要用到这些 external items 来编译的时候，就把 checkout -b 一个 本地的 branch 出来，remote 的一个 branch 给 merge 进来，然后编译，问题是这些个 remote branch 的镜像更新似乎不如 CVS 上的勤，结果跟主干上的代码就不一致了。</p>

<p>虽然归根结地还是 mozilla 土鳖：CVS 这种原始社会的玩意早该淘汰了，但经验之谈是：除非对 Mozilla 的代码树结构以及它的编译系统很熟悉，否则如果自己要编译 Firefox 还是<a href="http://developer.mozilla.org/en/docs/Mozilla_Source_Code_Via_CVS">直接从 CVS 上取</a>最省事，出问题的概率最小。</p>

<p>哦，顺便说一句，最近解决了一个 Firefox 3 在 Mac OS X 10.5 上的一个比较严重的 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=408965">bug</a>，涉及中文字体的载入和顺序，patch 已经进入主干，最新的 nightly build 中也已经包含，不妨试试。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjgod.org/2008/03/17/mozilla-cvs-git/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
