phabricator 结合 arcanist 使用

简介

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/

转载于:https://www.cnblogs.com/grissom007/p/7257297.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值