Tracking 2 branches in git-svn
Update: I've since written a script that automates this, see the follow up Fetching svn branches with git-svn .
The git-svn man page is less than helpful about how to track 2 subversion branches (actually, trunk and another branch). Typically trunk is the development branch and you have another branch for release that you backport fixes to. You can fetch all branches easily, but many times you don't want to and just want a particular branch. After many tries I've found something that works.
After you cloned a git-svn repository, you should have something like this in your .git/config:
[svn-remote "svn"]
url = svn://svn/mgmt/trunk
fetch = :refs/remotes/git-svn
Append the branch that you want:
[svn-remote "foo"]
url = svn://svn/mgmt/branches/foo_branch
fetch = :refs/remotes/git-foo
Then do:
git svn fetch -R foo -r 31144 # or whatever revision you want to start with
git branch -av # should see a new remote branch
git branch --track foo_branch git-foo
After you do this, you should see your .git/config now has a new entry:
[branch "foo_branch"]
remote = .
merge = refs/remotes/git-foo
git svn rebase your new branch:
git checkout foo_branch
git svn rebase
Now you can cherry-pick revisions from foo_branch, and dcommit as usual.
Out of country from 3/30 - 4/26
Comment will likely be disabled during the time so I won't come back with a large number of comment spam.
華文細黑
由於Linux下沒有甚麽好的中文字體,我一直都是用OS X下的華文細黑體,STHeiti。要fontconfig用STHeiti並不難,只要把~/.fonts.conf改成這樣就可以了:
<fontconfig>
<alias>
<family>serif</family>
<prefer>
<family>Bitstream Vera Serif</family>
<family>STHeiti</family>
</prefer>
</alias>
</fontconfig>
sans-serif和monospace都差不多,就不在這裏重複了。
最近發現有些網頁用了其他字體,一直也找不到原因。前兩天發現在中文Wikipedia時選擇簡體的話沒有問題,選擇香港或者是台灣的話都會使用另外的字體,選不轉換也沒有問題。靈機一觸:
$ fc-match :lang=zh-cn
华文细黑.ttf: "STHeiti" "Light"
$ fc-match :lang=zh
华文细黑.ttf: "STHeiti" "Light"
$ fc-match :lang=zh-tw
ShanHeiSun-Light.ttf: "AR PL Mingti2L Big5" "Reguler"
$ fc-match :lang=zh-hk
DFSongSd.ttf: "DFSongStd" "Regular"
細看之下:
$ fc-match STHeiTi -v | grep lang | tail -n 1
lang: aa|af|ar|ast|ava|ay|az-ir|be|bg|bi|bo|br|bs|ca|ce|ch|co|cs|cy|da|de|dz|el|en|eo|es|et|eu|fa|fi|fj|fo|fr|fur|fy|gd|gl|gv|ho|hr|hu|ia|id|ie|ik|io|is|it|ki|kl|ku-ir|kum|la|lb|lez|lt|lv|mg|mh|mn|mt|nb|nds|nl|nn|no|ny|oc|om|os|pl|ps-af|ps-pk|pt|rm|ru|se|sel|sh|sk|sl|sma|smj|smn|so|sq|sr|sv|sw|tn|tr|ts|ug|uk|ur|vo|vot|wa|wen|wo|xh|yap|zh-cn|zh-sg|zu(s)
雖然華文細黑能夠顯示繁體中文,它自己卻說不可以。花了不少時間改~/.fonts.conf,第一個成功的方法是:
<match>
<test name="lang" compare="eq"><string>zh-tw</string></test>
<edit name="lang"><string>zh</string></edit>
</match>
但感覺上這不太好,所以最後用了:
<match>
<test name="lang" compare="eq"><string>zh-tw</string></test>
<edit name="family" mode="append" binding="strong">
<string>STHeiti</string>
</edit>
</match>
<match>
<test name="lang" compare="eq"><string>zh-hk</string></test>
<edit name="family" mode="append" binding="strong">
<string>STHeiti</string>
</edit>
</match>
不知道為甚麽,直接match STHeiTi再append zh-tw和zh-hk去lang不成功。用fc-match -v見到改了,但依然用不了。
Web Applications
With my set of tabs that Firefox start every time:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
11982 webbrows 15 0 243m 86m 25m R 16.0 8.6 0:16.25 firefox-bin
Take Gmail out from the list:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
12038 webbrows 15 0 196m 63m 22m S 19.9 6.3 0:09.86 firefox-bin
Take Google Portfolio out too:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
12080 webbrows 15 0 173m 58m 21m S 4.3 5.7 0:09.86 firefox-bin
Welcome to Web 2.0!
Now I use Gmail Notifier instead of leaving the tab open all the time, since I rarely get new emails from my Gmail account anyway.
鼠年
不知不覺的又到了鼠年。從畢業後就開始有點期待鼠年,很難說是為甚麽,只是一種心裏的感覺。昨天在電話裏跟大陸的外婆拜年,她再一次告訴我年紀不小了,要快點「成家垃圾」了。每次聽她這樣說,我都會想自己還小,但再想一下,也對,自己已經半大不小的了。二十四歲,二十多歲的楷段已經差不多過了一半,以人均年齡七十多歲來算,也已經過了三份之一。跟一位同齡的同事說起,她提醒了我,最後那半老不死的三份之一不能算。二十多年呀,就這樣給她一句說沒了。
至於「成家垃圾」這事,也是無從入手。不是沒想過,但這個行業本來就是僧多粥少,大學和高中的時候又把心思都放在電腦上,人際圈子很小。別想了,見一步走一步吧。
說是不想,但真的不想是不可能的。不知是否相由心生,今晚吃飯的時候放上自己常用的away message "I am feeling hungry",便有人問我是否對女性饑渴… 我又不是色狼。
工作上,當初的衝勁越來越少,一個比較談得來的同事也快要轉組了。最近有幾件事跟上司有些意見不一樣,雖然不是甚麽大事,但也把自己的意見担白說了出來,說服不了他,也只好算了罷。