<HTML>
<HEAD>
<TITLE>Re: [vtk-developers] Auto install git hooks</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>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.<BR>
<BR>
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:<BR>
</SPAN></FONT><UL><LI><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>CMake be very insistent about installing the hooks. It should not be easy to miss or ignore the error.
</SPAN></FONT><LI><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>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.
</SPAN></FONT><LI><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>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.
</SPAN></FONT><LI><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>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.<BR>
</SPAN></FONT></UL><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
-Ken<BR>
<BR>
<BR>
On 6/17/10 12:54 PM, "Marcus D. Hanwell" <<a href="marcus.hanwell@kitware.com">marcus.hanwell@kitware.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>On Thu, Jun 17, 2010 at 2:48 PM, Moreland, Kenneth <<a href="kmorel@sandia.gov">kmorel@sandia.gov</a>> wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Folks,<BR>
<BR>
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.<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
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. <BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
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.<BR>
<BR>
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.<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
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).<BR>
<BR>
Does that seem like a reasonable middle ground? The dashboards all need to set the flag to ignore the error though.<BR>
<BR>
Thanks,<BR>
<BR>
Marcus<BR>
--<BR>
Marcus D. Hanwell, Ph.D.<BR>
R&D Engineer, Kitware Inc.<BR>
(518) 881-4937<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'><BR>
**** Kenneth Moreland<BR>
*** Sandia National Laboratories<BR>
*********** <BR>
*** *** *** email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** *** ** phone: (505) 844-8919<BR>
*** web: <a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>