Skip to content

Commit 99b9ceb

Browse files
author
epriestley
committed
Fix arcanist documentation to include "set -e" in example SVN hooks
Summary: "set -e" causes the script to exit if any command returns nonzero. Without it, we incorrectly discard the failure code. At Facebook everything runs in "set -e" or some equivalent so I never picked this up in testing. Test Plan: Added the hook to my svn local, it blocked bad commits and allowed good ones. >>> orbital:~/devtools/svnroot $ svn commit -m "quaa" Sending test.php Transmitting file data .svn: Commit failed (details follow): svn: Commit blocked by pre-commit hook (exit code 1) with output: LINT ERRORS This changeset has lint errors. You must fix all lint errors before you can commit. You can add '@bypass-lint' to your commit message to disable lint checks for this commit, or '@NOLINT' to the file with errors to disable lint for that file. >>> Lint for test.php: Error (XHP1) PHP Syntax Error! This file contains a syntax error: XHPAST Parse Error: syntax error, unexpected '}' on line 1 >>> 1 <?php asdddddd;!}} Reviewers: svemir, jungejason, tuomaspelkonen, aran Reviewed By: svemir CC: aran, svemir, epriestley Differential Revision: 864
1 parent f4e25b7 commit 99b9ceb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/docs/userguide/arcanist_hooks.diviner

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
Describes how to set up Arcanist as an SVN pre-commit hook.
55

6+
NOTE: This whole thing might be a little shaky and take a touch of finesse.
7+
68
= Installing Arcanist SVN Hooks =
79

810
You can install Arcanist as an SVN pre-commit hook, to reject commits which
@@ -13,6 +15,7 @@ engines.
1315
To install Arcanist as a pre-commit hook, add this to your svn/hooks/pre-commit:
1416

1517
#!/bin/sh
18+
set -e # Exit with an error code if this fails.
1619
/usr/local/bin/php -f /path/to/arcanist/bin/arc svn-hook-pre-commit $@ 1>&2
1720

1821
Make sure you make this file executable, or you'll get an error for every commit
@@ -31,6 +34,7 @@ build new linters or customize lint engines. For example, your hook might
3134
look like this:
3235

3336
#!/bin/sh
37+
set -e # Exit with an error code if this fails.
3438
/usr/local/bin/php -f /path/to/arcanist/bin/arc svn-hook-pre-commit \
3539
--load-phutil-library=/path/to/custom/lint/engine \
3640
--load-phutil-library=/path/to/custom/unittest/engine \

0 commit comments

Comments
 (0)