Page MenuHomePhabricator

Add 'hook.d/' directories to SVN and Git repositories for custom hooks
ClosedPublic

Authored by epriestley on Jan 3 2014, 6:23 PM.
Tags
None
Referenced Files
F18086305: D7884.id17837.diff
Tue, Aug 5, 9:00 PM
F17925120: D7884.id17844.diff
Wed, Jul 30, 11:01 AM
F17853939: D7884.id.diff
Sun, Jul 27, 2:31 PM
F17834549: D7884.diff
Sat, Jul 26, 2:27 PM
F17818143: D7884.id.diff
Sat, Jul 26, 12:09 AM
F17817777: D7884.id17844.diff
Fri, Jul 25, 11:51 PM
F17800874: D7884.diff
Fri, Jul 25, 7:04 AM
F17757303: D7884.id17844.diff
Tue, Jul 22, 3:59 PM
Subscribers

Details

Summary

Fixes T4189. Ref T4151. Allows repositories to have additional custom hooks for operations which can't be expressed with Herald (one such operation is lint).

This adds only local hook directories, since they're easier to use with existing hooks than global directories. I might add global directories eventually.

This doesn't support Mercurial since we have no demand for it and it's more complicated (we lose compatibility and power by just dropping a hooks.d/ somewhere).

Test Plan
  • Pulled hosted SVN and Git repos to verify the hook directories generate correctly.
  • Added a variety of hooks to the hook directories (echo + pass, fail).
  • Pushed commits and verified the hooks fired (output expected info, or failed).
  • Verified push log reflected the correct error code ("3", external) and detail ("nope.sh") when rejecting.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

epriestley updated this revision to Unknown Object (????).Jan 3 2014, 6:24 PM
  • Accidentally deleted some code we need, put it back.

Nice test plan too.

src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
183

I think this is the first new line I've seen inside a pht'd string. I guess that's coo' then?

src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
183

Yep, they should work fine. I think we already have all the code to unescape them for static analysis, too.