On Mon, Apr 10, 2017 at 20:32:18 +0100, Richard Maw wrote:
> (b) while you're right that it's currently only for
post-receive, I'd
> be interested in knowing if you think we should relax that?
I assumed it was deliberate to dissuade its use for external authentication
by fetching from an external service and failing for taking so long.
Fair, I couldn't think of the reasoning but this is sound enough for now.
> Is it worth showing therefore a passthrough for one of the
hooks? E.g.
>
> -- Example global-hooks/update.lua
> local hookf, repo, refname, oldsha, newsha = ...
> -- Do stuff with repo/refname/oldsha/newsha here
> --
> -- And finally (optionally) tail-chain through to the per-repo hook
> return hookf(repo, refname, oldsha, newsha)
Potentially.
I think I avoided doing so for the lack of examples
of when you would chain the hooks and when you would override though.
For that matter, if you wanted to provide a default hook
you would have to check whether repo:get("refs/gitano/admin:hooks/$hook.lua")
is a file that exists, since hookf defaults to a no-op callable.
I'm afraid I don't follow. Why would you have to check?
D.
--
Daniel Silverstone
http://www.digital-scurf.org/
PGP mail accepted and encouraged. Key Id: 3CCE BABE 206C 3B69