計划在團隊中采用code review,因為一直是用git作為代碼管理的,所以毫無疑問的就選擇了gerrit作為code review的工具。本以為很容易就能配置通過,但在配置的時候還是碰到了不少問題,比如中文編碼,發送郵件等等。折騰了小半天,終於搞定,在此記錄如下,以期對他人有所幫助。
一、中文編碼的問題
為妥善解決中文編碼的問題,對所有git repository做如下約定:
a、所有文本文件都必須存儲成utf8編碼
b、對git做如下設置:
git config --global core.quotepath false
git config --global i18n.logoutputencoding utf8
git config --global i18n.commitencoding utf8
安裝gerrit的時候對於數據庫的編碼設定為utf8
二、郵件的問題
對gerrit的sendmail設置如下:
[sendemail]
enable = true
smtpServer = smtp.gmail.com
smtpServerPort = 465
smtpEncryption = ssl
smtpUser = your_account@gmail..com
smtpPass = your_password
sslVerify = false
from = Code Review < your_account@gmail..com>