Surprisingly, Brandon Keepers from the Collective Idea thought the same way . Anyway, this is what my version of his script looks like:
#!/bin/sh toplevel_path='git rev-parse --show-toplevel' afplay -v 0.1 $toplevel_path/.git/hooks/happykids.wav > /dev/null 2>&1 &
I put this in a file called .git/hooks/post-commit.playsound . Then I run this from the main .git/hooks/post-commit script as follows:
#!/bin/sh toplevel_path='git rev-parse --show-toplevel' $toplevel_path/.git/hooks/post-commit.tweet $toplevel_path/.git/hooks/post-commit.playsound
Where the post-commit.tweet script is the script from fooobar.com/questions/299292 / .... If you also donβt tweet your commits, you can delete this line.
If you want this to work for every Git repository now, add these scripts to your git-core templates. You must find out where they are (this is different for each setting). For my Mac, they are located here: /opt/local/share/git-core/templates/hooks/post-commit .
source share