Permalink
Browse files

Move git hooks into templates

Apply hooks by default, in more circumstances.  (Should be picked up by
by "git init" and "git clone".)  Might be better if .git/hooks was
instead symlinked to the templates/hooks directory...
  • Loading branch information...
1 parent e39085e commit 8b0a5c6ad59ff752af2d54b59c193200cc8f0df5 @ithinkihaveacat committed Dec 28, 2012
Showing with 15 additions and 0 deletions.
  1. +3 −0 home/.gitconfig
  2. +7 −0 templates/hooks/README.md
  3. +5 −0 { → templates}/hooks/pre-commit
View
@@ -51,3 +51,6 @@
[hooks]
preCommitRegexp = rawlog|console\\.log
+
+[init]
+ templatedir = ~/.config/templates
@@ -0,0 +1,7 @@
+The contents of this directory probably come from:
+
+ $ git config --global init.templatedir
+
+The default hooks directory location (which contains some sample
+hooks) is `/usr/share/git-core/templates`. (May be different if using
+`brew` or similar.)
@@ -1,5 +1,10 @@
#!/bin/sh
+# Install by copying into .git/hooks/pre-commit, or permanently
+# (affects init and clone) via:
+#
+# $ git config --global init.templatedir '~/.config/templates'
+#
# Configure via something like:
#
# $ git config --global hooks.preCommitRegexp 'var_dump|console\.log'

0 comments on commit 8b0a5c6

Please sign in to comment.