Arcanist 安装及使用

Arcanist是Phabricator的命令行接口.php

安装:

# sudo apt-get install php5 php5-curl   # ubuntu 系统
# sudo yum install php5 # centos 系统

# cd /usr/local/bin    # 安装目标路径, 如目录不在PATH, 则将 export PATH=$PATH:/usr/local/bin 加入 .bashrc
# git clone https://github.com/phacility/libphutil.git
# git clone https://github.com/phacility/arcanist.git
# ln -s arcanist/bin/arc arc # 建立软连接, 使arc命令位于PATH中
在.bashrc加入下面一行, 使arc命令能够自动补全:
source /usr/local/bin/arcanist/resources/shell/bash-completion

(或用 npm 安装: npm install -g arcanist , 无需配置, 参见 https://www.npmjs.com/package/arcanist)git

配置:

在git库目录建立 .arcconfig, 内容以下:github

{
  "phabricator.uri" : "https://你的phabricator网站的域名"
}

安装证书:web

# arc install-certificate

会提示你用浏览器打开一个连接,获取一个Token,复制该 Token, 粘贴到终端便可shell

使用:

arc help --full # 查看详细帮助
arc diff  # 提交默认的diff
arc diff xxx --preview  # 提交针对某个分支的commit,并只生成diff文件,不在web端建立revision
arc which # 查看arc diff 会提交哪一个范围的diff
arc land  # 提交代码,删除该分支 或 使用 git push
arc list  # 查看有哪些revision和其状态

工做流程:npm

  1. 运行 git commit -am "修复了 XX BUG" ,commit你的改动
  2. 运行 arc diff ,提交Differential,它会提醒你填写一些信息:
    Test Plan - 必填,详细说明你的测试计划;
    Reviewers - 必填,审查人的帐户,多个使用","隔开;
    Subscribers - 非必填订阅人,多个使用","隔开。
  3. 提交成功后,审查人就能在Differential收到通知
  4. 若是 review 没有经过,你须要在原来的基础上修改,修改完并 commit 以后须要执行 arc diff --update D(id) 继续 review
  5. 若是 review 经过了,只须要运行 arc land, arc 会将你当前分支合并的 master 上,并删除当前分支

参考:json

http://share.zuijiao.net/?p=22ubuntu

https://secure.phabricator.com/book/phabricator/article/arcanist/centos

https://secure.phabricator.com/book/phabricator/浏览器

https://www.npmjs.com/package/arcanist

相关文章
相关标签/搜索