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
Unknown Object (File)
Tue, Dec 17, 12:51 PM
Unknown Object (File)
Tue, Dec 17, 6:44 AM
Unknown Object (File)
Tue, Dec 17, 3:59 AM
Unknown Object (File)
Sun, Dec 15, 4:45 PM
Unknown Object (File)
Sun, Dec 15, 12:12 PM
Unknown Object (File)
Sun, Dec 15, 12:12 PM
Unknown Object (File)
Sun, Dec 15, 12:12 PM
Unknown Object (File)
Sat, Dec 14, 7:51 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.