[vcsh] hook system for vcsh

Vincent Demeester vincent at demeester.fr
Mon Jan 9 22:58:36 CET 2012


Hi,

Basically the question that condition the design of the hook system are :

- Is the hook(s) sourced or executed ?
- Is it possible to stack hooks automatically (or by writing something in the 
  hook) ?

And the next question would be where to the `run_hook` ?
At first sight, I thought at start and end of each function: pre-init and post-
init for the init method, etc.
But, what about the clone function for example : by using a naive approach the
hook « graph call » would be : pre-clone, pre-init, post-init, post-clone. That
work for my use case (as I just need to write a post-init hook) but what if the
need is to run a hook after the `git fetch` in clone and before the `git merge`.

Finally, about the ability to enable/disable hook like the system that couples
vcsh and mr, that could be very good, but I'm not sure to see how the filesystem
would be ; something like $VCSH_HOOK_D/available.d/… and 
$VCSH_HOOK_D/config.d/… ?

Vincent


More information about the vcs-home mailing list