Newer
Older
<!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.1.2//EN"
"docbook/docbookx.dtd">
<refentry id='irkerhook.1'>
<refmeta>
<refentrytitle>irkerhook</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class='date'>Aug 27 2012</refmiscinfo>
<refmiscinfo class='source'>irkerd</refmiscinfo>
<refmiscinfo class='product'>irkerd</refmiscinfo>
<refmiscinfo class='manual'>Commands</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>irkerhook</refname>
<refpurpose>repository hook script issuing irker notifications</refpurpose>
</refnamediv>
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
<command>irkerhook.py</command>
<arg>-n</arg>
<arg>-V</arg>
<arg rep='repeat'><replaceable>variable=value</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 id='description'><title>DESCRIPTION</title>
<para><application>irkerhook.py</application> is a Python script intended
to be called from the post-commit hook of a version-control repository. Its
job is to collect information about the commit that fired the hook (and
possibly preferences set by the repository owner) and ship that information
to an instance of <application>irkerd</application> for forwarding to
various announcement channels.</para>
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<para>The proper invocation and behavior of
<application>irkerhook.py</application> varies depending on which
VCS (version-control system) is calling it. There are four different places
from which it may extract information:</para>
<orderedlist>
<listitem><para>Calls to VCS utilities.</para></listitem>
<listitem><para>In VCSes like git that support user-settable configuration
variables, variables with the prefix "irker.".</para></listitem>
<listitem><para>In other VCSes, a configuration file, "irker.conf", in the
repository's internals directory.</para></listitem>
<listitem><para>Command-line arguments of the form
variable=value.</para></listitem>
</orderedlist>
<para>The following variables are general to all supported VCSes:</para>
<variablelist>
<varlistentry>
<term>project</term>
<listitem>
<para>The name of the project. Should be a relatively short identifier;
will usually appear at the very beginning of a notification.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>repo</term>
<listitem>
<para>The name of the repository top-level directory. If not
specified, defaults to a lowercased copy of the project name.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>channels</term>
<listitem>
<para>An IRC channel URL, or comma-separated list of same, identifying
channels to which notofications are to be sent. If not specified, the
defaults channel list id the freenode #commits channel plus the freenode
channel named by the project variable.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>server</term>
<listitem>
<para>The host on which the notification-relaying irker daemon is expected
to reside. Defaults to "localhost".</para>
</listitem>
</varlistentry>
<varlistentry>
<term>tcp</term>
<listitem>
<para>If "true", use TCP for communication; if "false", use UDP.
Defaults to "false".</para>
</listitem>
</varlistentry>
</variablelist>
<refsect2 id="git"><title>git</title>
<para>Under git, <application>irkerhook.py</application> does not
require any arguments. All variables may be set in the repo
<filename>config</filename> file, and are distinguished with
the application prefix "irker.". Command-line variable=value
arguments are accepted but not required. No attempt is made
to interpret an <filename>irker.conf</filename> file.</para>
<para>The default value of the "project" variable is the basename
of the repository directory.</para>
<para>There is one git-specific variable, "revformat", controlling
the format of the commit identifier in a notification. It
may have the following values:</para>
<variablelist>
<varlistentry>
<term>raw</term>
<listitem><para>full hex ID of commit</para></listitem>
</varlistentry>
<varlistentry>
<term>short</term>
<listitem><para>first 12 chars of hex ID</para></listitem>
</varlistentry>
<varlistentry>
<term>describe</term>
<listitem><para>describe relative to last tag, falling back to short</para></listitem>
</varlistentry>
</variablelist>
<para>The default is 'describe'.</para>
</refsect2>
<refsect2 id="svn"><title>Subversion</title>
<para>Under Subversion, <application>irkerhook.py</application>
requires two arguments: "repository=" (the absolute pathname of the
Subversion repository) and "commit=" (the numeric revision level of
the commit). The values must be the two arguments that Subversion
gives its post-commit hook. Thus, a typical invocation in the post-commit
script will look like this:</para>
<programlisting>
irkerhook.py repository=$1 commit=$2
</programlisting>
<para>Other variable=value settings may also be
given on the command line, and will override any settings in an
<filename>irker.conf</filename> file.</para>
<para>The default for the project variable is the basename of the
(required) repository= argument.</para>
<para>If an <filename>irker.conf</filename> file exists in the repository
root directory (not the checkout directory but where internals such as the
"format" file live) the hook will interpret variable settings from it. Here
is an example of what such a file might look like:</para>
<programlisting>
# irkerhook variable settings for the irker project
project = irker
channels = irc://chat.freenode/irker,irc://chat.freenode/commits
tcp = false
</programlisting>
<para>There are no Subversion-specific variables.</para>
</refsect2>
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
</refsect1>
<refsect1 id='options'><title>OPTIONS</title>
<para><application>irkerhook.py</application> takes the following
options:</para>
<variablelist>
<varlistentry>
<term>-n</term>
<listitem><para>Suppress transmission to a daemon. Instead, dump the
generated JSON request to standard output. Useful for
debugging.</para></listitem>
</varlistentry>
<varlistentry>
<term>-V</term>
<listitem><para>Write the program version to stdout and
terminate.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id='authors'><title>AUTHOR</title>
<para>Eric S. Raymond <email>esr@snark.thyrsus.com</email>. See the
project page at <ulink
url='http://www.catb.org/~esr/'>http://www.catb.org/~esr/irker</ulink>
for updates and other resources.</para>
</refsect1>
</refentry>