[vtk-developers] Auto install git hooks

Moreland, Kenneth kmorel at sandia.gov
Thu Jun 17 16:06:20 EDT 2010


That's a good point about CMake modifying the source tree, but I think this is one of those cases we should let the rule slide.  In this case we are installing what, IMHO, git should be pulling for us.  Although the Wiki says its optional, it really should be enforced for anyone who makes any commit to any repository.

I'm less thrilled about the "error if not installed" option because it still pushes the responsibility back on every developer.  It could also wreck havoc on the dashboards as there will be a delay in getting someone to fix the warning.  But if that is the general consensus, it's way better than what we have now, which is nothing.  If that is the path we choose to follow, then I would hope that the following could be be features:

 *   CMake be very insistent about installing the hooks.  It should not be easy to miss or ignore the error.
 *   The error should give clear instructions on how to install the hooks.  It's annoying to have to find it in the Wiki every time.
 *   The check should also look for any updates to the hooks in addition to just seeing if they are installed.  One of the problems I run into is that even though I try to be diligent about installing hooks, I miss changes pushed to the repository.
 *   The check should turn itself off if not run in a git repository.  A user who downloaded the source from the web would never be able to satisfy the requirement.

-Ken


On 6/17/10 12:54 PM, "Marcus D. Hanwell" <marcus.hanwell at kitware.com> wrote:

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



   ****      Kenneth Moreland
    ***      Sandia National Laboratories
***********
*** *** ***  email: kmorel at sandia.gov
**  ***  **  phone: (505) 844-8919
    ***      web:   http://www.cs.unm.edu/~kmorel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100617/9ab31a2f/attachment.html>


More information about the vtk-developers mailing list