Skip to content

Commit

Permalink
Move git hooks into templates
Browse files Browse the repository at this point in the history
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
ithinkihaveacat committed Dec 28, 2012
1 parent e39085e commit 8b0a5c6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions home/.gitconfig
Expand Up @@ -51,3 +51,6 @@


[hooks] [hooks]
preCommitRegexp = rawlog|console\\.log preCommitRegexp = rawlog|console\\.log

[init]
templatedir = ~/.config/templates
7 changes: 7 additions & 0 deletions templates/hooks/README.md
@@ -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.)
5 changes: 5 additions & 0 deletions hooks/pre-commit → templates/hooks/pre-commit
@@ -1,5 +1,10 @@
#!/bin/sh #!/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: # Configure via something like:
# #
# $ git config --global hooks.preCommitRegexp 'var_dump|console\.log' # $ git config --global hooks.preCommitRegexp 'var_dump|console\.log'
Expand Down

0 comments on commit 8b0a5c6

Please sign in to comment.