ソースコード読経会 
2014/09/23 
豊吉政彦
今回の目的 
• コーディング能力の向上 
• 凄い人のコードを読めば能力向上するのでは? 
• 凄い人って誰だ?
お題
会の流れ 
1. コンパイル(参考資料参照の事) 
2. まずは動かす 
3. それぞれのファイルについて読経 
4. 読経した結果はパワポでまとめ
各プログラム解説 
• init-db : DBの初期化(git init) 
• update-cache : トレースファイルの追加(git add) 
• write-tree : treeの作成(git commit) 
• commit-tree : データベースへ登録(git push) 
• cat-file : ファイル名の表示 
• read-tree : tree内容の表示 
• show-diff : 最新コミットとの差異(git diff)
まずは動かす 
• % ./init-db 
• % ./update-cache README 
• % ./write-tree 
• % ./commit-tree 
• READMEを編集 
• % ./show_diff 
• % ./update-cache README 
• % ./write-tree 
• % ./commit-tree 
• % ./show_diff
Let’s 読経
資料:コンパイル関連 
• git clone https://github.com/git/git 
• git checkout e83c5163 
• zlibとcryptoをリンク(LIBS += -lz lcrypto) 
• st_mtimでエラー→st_mtimespec 
• st_ctimでエラー→st_ctimespec

コード読経会