Whamcloud - gitweb
LU-2083 build: install git commit hooks automatically
authorAndreas Dilger <adilger@whamcloud.com>
Wed, 3 Oct 2012 22:18:54 +0000 (16:18 -0600)
committerOleg Drokin <green@whamcloud.com>
Wed, 17 Oct 2012 01:26:56 +0000 (21:26 -0400)
Install the Lustre Git commit hooks into .git/hooks/ by default when
autogen.sh is run, so that they are present when patches are being
committed.  This avoids the relatively common case where a new tree
is checked out by new or experienced developers and is missing the
commit hooks when patches are being submitted.

While the commit hooks are sure to be installed for in any tree that
was built, this isn't a guarantee that the hooks will be installed in
every tree that has a commit, but it is very likely to be the case.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I6a15420fb7a35b790c1e816c67e20a8004500c1e
Reviewed-on: http://review.whamcloud.com/4175
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: Wei Liu <wei3.liu@intel.com>
Reviewed-by: Bruce Korb <bruce_korb@xyratex.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>

index a32c3f8..1fce0a4 100644 (file)
@@ -1,2 +1,9 @@
+# install Lustre Git commit hooks by default - LU-2083
+for HOOK in commit-msg prepare-commit-msg; do
+       [ -e .git/hooks/$HOOK ] || ln -sf ../build/$HOOK .git/hooks/
 exec bash build/autogen.sh $@