Skip to content

Commit

Permalink
Git: improve git hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
mhinz committed Oct 24, 2016
1 parent 647783f commit 57a1afe
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .config/git/template/hooks/ctags
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh

ctags --fields=+S --exclude=.git --tag-relative -Rf .git/tags.$$
mv .git/tags.$$ .git/tags
if [ `pwd` != $HOME ]; then
ctags --fields=+S --exclude=.git --tag-relative -Rf .git/tags.$$
mv .git/tags.$$ .git/tags
fi
8 changes: 7 additions & 1 deletion .config/git/template/hooks/post-checkout
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/bin/sh

.git/hooks/ctags > /dev/null 2>&1 &
if [ `uname -s` = Darwin ]; then
osascript <<-EOF
display notification "ctags -R `pwd`" with title "post-checkout"
EOF
fi
.git/hooks/ctags 1>/dev/null 2>&1 &
8 changes: 7 additions & 1 deletion .config/git/template/hooks/post-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/bin/sh

.git/hooks/ctags >/dev/null 2>&1 &
if [ `uname -s` = Darwin ]; then
osascript <<-EOF
display notification "ctags -R `pwd`" with title "post-commit"
EOF
fi
.git/hooks/ctags 1>/dev/null 2>&1 &
8 changes: 7 additions & 1 deletion .config/git/template/hooks/post-merge
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/bin/sh

.git/hooks/ctags > /dev/null 2>&1 &
if [ `uname -s` = Darwin ]; then
osascript <<-EOF
display notification "ctags -R `pwd`" with title "post-merge"
EOF
fi
.git/hooks/ctags 1>/dev/null 2>&1 &

0 comments on commit 57a1afe

Please sign in to comment.