<HTML>
<HEAD>
<TITLE>Re: [vtk-developers] Auto install git hooks</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Maybe I’m being stupid, but if you are installing a pre-commit hook to check the hooks, why not just install the hooks you really want in the first place?<BR>
<BR>
-Ken<BR>
<BR>
<BR>
On 7/16/10 10:30 AM, "Brad King" <<a href="brad.king@kitware.com">brad.king@kitware.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>On 07/05/2010 10:48 AM, Marcus D. Hanwell wrote:<BR>
> I pressed the button, and pushed this change into VTK master. I was<BR>
> going to check the dashboards and see what happens. I can push a very<BR>
> similar change into ParaView, but it just struck me that this has only<BR>
> been raised on the VTK developer list.<BR>
><BR>
> I tried to make the instructions as explicit as possible for users and<BR>
> developers. Please let me know if you see any problems.<BR>
<BR>
I updated the approach so that the instructions only get printed<BR>
when a developer first tries to commit:<BR>
<BR>
  <a href="http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=ce1b0901">http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=ce1b0901</a><BR>
<BR>
-Brad<BR>
<BR>
commit ce1b09015176ea1c4191b726211f6028dede26c4<BR>
Author: Brad King <<a href="brad.king@kitware.com">brad.king@kitware.com</a>><BR>
Date:   Fri Jul 16 10:22:24 2010 -0400<BR>
<BR>
    Delay Git hooks setup until first commit<BR>
<BR>
    Install a small .git/hooks/pre-commit script in the source tree at CMake<BR>
    configuration time instead of telling the user to do it.  When the user<BR>
    first attempts to commit this bootstrapping hook will trigger and print<BR>
    instructions to install the real hooks.  This approach allows us to<BR>
    require local hooks for commit but not for those who just want to build.<BR>
<BR>
 .gitattributes                 |    1 +<BR>
 CMake/pre-commit               |   11 +++++++++++<BR>
 CMake/vtkCheckSourceTree.cmake |   29 +++++++++++++----------------<BR>
 3 files changed, 25 insertions(+), 16 deletions(-)<BR>
<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>