Phabricator/Arcanist

Arcanist is a command line tool that can be used to submit, review and land (accept) patches to git repositories that are hosted by Phabricator.

Installation
Arcanist needs PHP bcmath and curl extensions to be installed. Installation on ubuntu can be done easily using dpkg, package "arcanist" is available in official ubuntu repo.

sudo apt-get install arcanist # ubuntu / debian

Installing using git
You can install the Arcanist using Git.

Pick up some installation directory (for example ).

You should get two subdirectories in the  directory:   and

Now you should add  directory to your PATH - typically by editing   or   in your home directory.

Setup
Which should respond with something like:

Set key 'default' = "https://phabricator.wikimedia.org/" in global config (was null)

Then you should install your personal Phabricator key.

Arc will prompt you to login to Phabricator via the web browser and pick up the key from the specified location:

Installing certificate for 'https://phabricator.wikimedia.org/api/'... Trying to connect to server... Connection OK!

Login to phabricator
Open this page in your browser and login to Phabricator if necessary:

https://phabricator.wikimedia.org/conduit/token/

Then paste the token on that page below.

Paste token from that page:

When clicking a link the following webpage is presented:

Certificate Install Token Copy and paste this token into the prompt given to you by "arc install-certificate":

xasdase34531asdhccasdsddadxtluyx5r5nqmu6xj5gjwxagzrej

arc will then complete the install process for you.

After the token is pasted into the arc window it should say:

Downloading authentication certificate... Installing certificate for 'yourusername'... Writing ~/.arcrc... SUCCESS! Certificate installed.

Basics
Arcanist is a tool that controls "differential" in phabricator. That is using similar workflow as gerrit. You basically make your changes, push them to differential (using arc diff) and someone needs to approve them and land them.

Diff
arc diff will submit your changes to review, example workflow:

git commit -a arc diff
 * 1) changes

Landing
Once a change is approved, you can land it, given that you have push access to repository.

There is more than one way to land a patch with arcanist / differential.

Merging another author's change
This should generally be done with ` ` followed by ` ` as in the following example:

git checkout master arc patch -nobranch D### git push

Landing your own patch
In a traditional plain git workflow you would generally merge your feature branch manually and push it up to the remote.

Arcanist provides the arc land workflow to automate this process. Arc land is epriestley's workflow for landing patches in the upstream, therefore, it is probably best understood by studying the official epriestley workflow.

Example
Now you can clone experimental respository using Git:

You can now go to the repository and try fetching some code:

The system will ask you:

This diff is for the 'E3Experiments' project but the working copy belongs to the '' project. Still try to apply it? [Y/n] y

Answer 'Y' and Arcanist should download the change:

Created and checked out branch arcpatch-D3. Downloading binary data... Downloading binary data... Downloading binary data... Downloading binary data... OKAY Successfully committed patch.

And you can see the patch in your local repository: master     e40fce0 [origin/master] Rename events.js -> communityClicks.js
 * arcpatch-D3 be7cfd9 Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/E3Experiments into munaf/pef2

Now it's time to explore  and the User's Guide.

Khan Academy's "Using Phabricator" documentation is a really well written introduction to arcanist and other related topics.