文章出處

簡介

arcanist 是 phabricator 接口的命令工具,主要用于提交 diff 和 push review 通過的commit。

安裝

下載源碼,然后指定系統的環境變量即可

$ some_install_path/ $ git clone https://github.com/phacility/libphutil.git
$ some_install_path/ $ git clone https://github.com/phacility/arcanist.git

指定環境變量

-- 修改 .bash_profile(如果裝有 zsh, 則修改 .zshrc),下面的 /Users/Grissom/mydocs/arc/arcanist/bin 就是我本機 arc 源碼所在的路徑
$ export PATH=${PATH}:/usr/local/mysql/bin:/Users/Grissom/mydocs/arc/arcanist/bin

-- 然后運行以下命令使之起效 
$ source .bash_profile 

-- 查看是否安裝好
$ arc help

-- 配置arc的默認編輯器,我使用vim
$ arc set-config editor "vim"

--配置默認的phabricator的uri,uri為團隊的phabricator主頁的url
$ arc set-config default <your phabricator uri>

--在項目的根目錄下建.arcconfig配置文件,文件中至少要填入以下內容
{
  "project.name": "對應 phabricator 的 project name",
  "phabricator.uri": "<your phabricator uri>"
}

-- 為項目安裝證書,用于phabricator的認證。
$ arc install-certificate
-- 上面命令會提示到指定 uri 獲取 token, 然后粘貼下去,就 ok 了

使用

--創建本地分支
$ git checkout -b b_test_0729
-- 修改代碼, 然后提交
$ git add . && git commit -m "test"

--創建 revision 并提交到 phabricator
$ arc diff b_test_0729

--上面命令會彈出 vim ,需要填寫一些信息,如下

<<Replace this line with your revision title>  -- title 必填

Summary:  -- 簡述 必填

Test Plan:  -- 測試計劃 必填,如果沒有,可以填: NO

Reviewers:  -- 指定審核人,必填,注意審查人是在 phabricator 上注冊的用戶賬號,而且 Reviewers: 與審查人之間不能有空格,這是個坑

Subscribers: -- 可刪除

# NEW DIFFERENTIAL REVISION
# Describe the changes in this new revision.
#
# arc could not identify any existing revision in your working copy.
# If you intended to update an existing revision, use:
#
#   $ arc diff --update <revision>

提交

如果 Reviewer 審查通過,就可以用 arc 進行提交了

$ arc land  -- 會自動合并到 origin master 并且刪除當前本地分支

參考

[https://secure.phabricator.com/book/phabricator/article/arcanist_windows/] (windows 系統參考 https://secure.phabricator.com/book/phabricator/article/arcanist_windows/)
https://sezina.github.io/2013/07/16/phabricatorming-ling-xing-gong-ju-arcanistde-ji-ben-yong-fa/
https://www.slahser.com/2016/02/29/Arcanist%E7%94%A8%E6%B3%95%E7%AE%80%E4%BB%8B/


文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

    大師兄 發表在 痞客邦 留言(0) 人氣()