Skip to content
Snippets Groups Projects
Commit 4d730bc5 authored by Antoine Beaupré's avatar Antoine Beaupré Committed by Eric S. Raymond
Browse files

add a more helpful hook example: in post-receive

the previous suggestion seemed to be about the update hook, but it's
usually bad practice to setup notification hooks there, because if
they fail, the push fails.

parsing the git documentation to find exactly the incantation is not
exactly trivial either...
parent f3d87f4e
No related branches found
No related tags found
No related merge requests found
......@@ -193,6 +193,20 @@ irkerhook.py --refname=refs/heads/master HEAD
<para>However, this will not give the right result when you push to
a non-default branch of a bare repo.</para>
<para>A typical way to install this hook is actually in the
<filename>post-receive</filename> hook, because it gets all the
necessary details and will not abort the push on failure. Use the
following script:
<programlisting>
#!/bin/sh
echo "sending IRC notification"
while read old new refname; do
irkerhook --refname=${refname} $(git rev-list --reverse ${old}..${new})
done
</programlisting>
<para>Preferences may be set in the repo <filename>config</filename>
file in an [irker] section. Here is an example of what that can look
like:</para>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment