Created
November 17, 2008 04:52
-
-
Save foca/25662 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using this hook, it is easy to generate mails describing the updates to the repository. This example script sends one mail message per ref listing the | |
commits pushed to the repository: | |
#!/bin/sh | |
# mail out commit update information. | |
while read oval nval ref | |
do | |
if expr "$oval" : '0*$' >/dev/null | |
then | |
echo "Created a new ref, with the following commits:" | |
git-rev-list --pretty "$nval" | |
else | |
echo "New commits:" | |
git-rev-list --pretty "$nval" "^$oval" | |
fi | | |
mail -s "Changes to ref $ref" commit-list@mydomain | |
done | |
exit 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment