Skip to content

Instantly share code, notes, and snippets.

@foca
Created November 17, 2008 04:52
Show Gist options
  • Save foca/25662 to your computer and use it in GitHub Desktop.
Save foca/25662 to your computer and use it in GitHub Desktop.
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