Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F32567744
arcanist_hooks.diviner
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
1 KB
Subscribers
None
arcanist_hooks.diviner
View Options
@title
Arcanist User Guide: Repository Hooks
@group
userguide
Describes how to set up Arcanist as an SVN pre-commit hook.
NOTE: This whole thing might be a little shaky and take a touch of finesse.
= Installing Arcanist SVN Hooks =
You can install Arcanist as an SVN pre-commit hook, to reject commits which
contain lint errors. The immediate value of this is that syntax errors won't
be committable, but you can block other kinds of badness with appropriate lint
engines.
To install Arcanist as a pre-commit hook, add this to your svn/hooks/pre-commit:
#!/bin/sh
set -e # Exit with an error code if this fails.
/usr/local/bin/php -f /path/to/arcanist/bin/arc svn-hook-pre-commit $@ 1>&2
Make sure you make this file executable, or you'll get an error for every commit
with an unhelpful error message. You also need to specify the full path to PHP
since SVN nukes ENV before executing scripts. Alternatively you can specify
PATH explicitly.
If your project is configured to run linters or lint engines which aren't part
of Arcanist, specify where to load them from with
##--load-phutil-library##
:
--load-phutil-library=/path/to/library/root
Since SVN commit hooks run without access to a working copy, you'll need to keep
one checked out somewhere and reference it with
##--load-phutil-library##
if you
build new linters or customize lint engines. For example, your hook might
look like this:
#!/bin/sh
set -e # Exit with an error code if this fails.
/usr/local/bin/php -f /path/to/arcanist/bin/arc svn-hook-pre-commit \
--load-phutil-library=/path/to/custom/lint/engine \
--load-phutil-library=/path/to/custom/unittest/engine \
$@ 1>&2
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 14, 8:16 PM (1 d, 17 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1f/fc/5cd268d90f5552cfbe0a61d151cf
Attached To
rPHAB Phabricator
Event Timeline
Log In to Comment