Minor fixup to documentation of hooks in git-receive-pack.
Small additional changes to the cbb84e5d174cf33fd4dcf3136de50a886ff9a2e2 commit, which introduced documentation to pre-receive and post-receive: - Mention that stdout and stderr are equivalent. - Add one cross-section link and fix one other. - Fix information on advantages of post-receive over post-update. Signed-off-by: Jan Hudec <bulb@ucw.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
Jan Hudec committed
May 12, 2007 at 23:43 UTC
24a0d61e51c0a5e3b9d799af4fcfdd5dc4405502
1 file changed
+20
-17
Documentation/hooks.txt
+20
-17
@@ -115,8 +115,9 @@ If the hook exits with non-zero status, none of the refs will be
115
updated. If the hook exits with zero, updating of individual refs can
116
still be prevented by the <<update,'update'>> hook.
117
118
-If you want to report something to the `git-send-pack` on the other end,
119
-you can simply `echo` your messages.
118
+Both standard output and standard error output are forwarded to
119
+`git-send-pack` on the other end, so you can simply `echo` messages
120
+for the user.
121
122
[[update]]
123
update
@@ -153,9 +154,9 @@ Another use suggested on the mailing list is to use this hook to
154
implement access control which is finer grained than the one
155
based on filesystem group.
156
156
-The standard output of this hook is sent to `stderr`, so if you
157
-want to report something to the `git-send-pack` on the other end,
158
-you can simply `echo` your messages.
157
+Both standard output and standard error output are forwarded to
158
+`git-send-pack` on the other end, so you can simply `echo` messages
159
+for the user.
160
161
The default 'update' hook, when enabled--and with
162
`hooks.allowunannotated` config option turned on--prevents
@@ -171,17 +172,20 @@ It executes on the remote repository once after all the refs have
172
been updated.
173
174
This hook executes once for the receive operation. It takes no
174
-arguments, but gets the same information as the `pre-receive`
175
+arguments, but gets the same information as the
176
+<<pre-receive,'pre-receive'>>
177
hook does on its standard input.
178
179
This hook does not affect the outcome of `git-receive-pack`, as it
180
is called after the real work is done.
181
180
-This supersedes the [[post-update]] hook in that it actually get's
181
-both old and new values of all the refs.
182
+This supersedes the <<post-update,'post-update'>> hook in that it get's
183
+both old and new values of all the refs in addition to their
184
+names.
185
183
-If you want to report something to the `git-send-pack` on the
184
-other end, you can simply `echo` your messages.
186
+Both standard output and standard error output are forwarded to
187
+`git-send-pack` on the other end, so you can simply `echo` messages
188
+for the user.
189
190
The default 'post-receive' hook is empty, but there is
191
a sample script `post-receive-email` provided in the `contrib/hooks`
@@ -205,12 +209,10 @@ the outcome of `git-receive-pack`.
209
210
The 'post-update' hook can tell what are the heads that were pushed,
211
but it does not know what their original and updated values are,
208
-so it is a poor place to do log old..new.
209
-
210
-In general, `post-receive` hook is preferred when the hook needs
211
-to decide its acion on the status of the entire set of refs
212
-being updated, as this hook is called once per ref, with
213
-information only on a single ref at a time.
212
+so it is a poor place to do log old..new. The
213
+<<post-receive,'post-receive'>> hook does get both original and
214
+updated values of the refs. You might consider it instead if you need
215
+them.
216
217
When enabled, the default 'post-update' hook runs
218
`git-update-server-info` to keep the information used by dumb
@@ -219,4 +221,5 @@ a git repository that is accessible via HTTP, you should
221
probably enable this hook.
222
223
Both standard output and standard error output are forwarded to
222
-`git-send-pack` on the other end.
224
+`git-send-pack` on the other end, so you can simply `echo` messages
225
+for the user.