[vtk-developers] Auto install git hooks

Marcus D. Hanwell marcus.hanwell at kitware.com
Thu Jun 17 14:54:00 EDT 2010


On Thu, Jun 17, 2010 at 2:48 PM, Moreland, Kenneth <kmorel at sandia.gov>wrote:

>  Folks,
>
> I’ve been burned by trying to push commits to the main VTK/ParaView
> repository that are rejected due to the hooks in the server.  The problem,
> as always, is because the commits were created in a local repository that
> had neglected to install hooks.  I can see from the mailing list that I am
> not the only one.
>

In the Titan project I added a check for the hooks during configure. If you
did not have the hooks installed it will error out with instructions on how
to install the hooks.

>
> It would be great if local hooks were not optional.  Git does not support
> that, but perhaps we could do the next best thing by automatically
> installing or updating the hooks during the compile or build processes.  For
> all practical purposes, this would enforce the hooks.
>
> I think implementing this would be straightforward.  You could simply issue
> CMake commands that check for the .git directory and then run the git
> commands that are listed on the web site.  Yes, things could get complicated
> if someone has a repository that does not happen to have the origin remote
> point to the Kitware repository.  But I speculate that 90% of clones do fall
> in this category, and I would rather have it work for most people than have
> it not implemented for anyone.
>

I am not sure about have CMake modifying the source tree, but if there is
demand I could likely port more of the logic from Titan to VTK and ParaView
to at least warn (with a USE flag to ignore the error).

Does that seem like a reasonable middle ground? The dashboards all need to
set the flag to ignore the error though.

Thanks,

Marcus
--
Marcus D. Hanwell, Ph.D.
R&D Engineer, Kitware Inc.
(518) 881-4937
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100617/234cbb92/attachment.html>


More information about the vtk-developers mailing list