diff options
author | Junio C Hamano <junio@hera.kernel.org> | 2007-03-12 07:29:20 +0000 |
---|---|---|
committer | Junio C Hamano <junio@hera.kernel.org> | 2007-03-12 07:29:20 +0000 |
commit | c51fede9f2fdd66e06416d7865b023924b52e659 (patch) | |
tree | 19a562e90847738d119806fae209a948d74e0107 /git-receive-pack.html | |
parent | d15328acbacd5d5b1b56a7ee143ccf7db9e7549e (diff) | |
download | git-htmldocs-c51fede9f2fdd66e06416d7865b023924b52e659.tar.gz |
Autogenerated HTML docs for v1.5.0.3-382-g34572
Diffstat (limited to 'git-receive-pack.html')
-rw-r--r-- | git-receive-pack.html | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/git-receive-pack.html b/git-receive-pack.html index d02c4acfb..d3ef3237e 100644 --- a/git-receive-pack.html +++ b/git-receive-pack.html @@ -308,14 +308,14 @@ are not fast-forwards.</p> <h2>pre-receive Hook</h2>
<div class="sectionbody">
<p>Before any ref is updated, if $GIT_DIR/hooks/pre-receive file exists
-and is executable, it will be invoked once, with three parameters
-per ref to be updated:</p>
+and is executable, it will be invoked once with no parameters. The
+standard input of the hook will be one line per ref to be updated:</p>
<div class="literalblock">
<div class="content">
-<pre><tt>$GIT_DIR/hooks/pre-receive (refname sha1-old sha1-new)+</tt></pre>
+<pre><tt>sha1-old SP sha1-new SP refname LF</tt></pre>
</div></div>
-<p>The refname parameter is relative to $GIT_DIR; e.g. for the master
-head this is "refs/heads/master". The two sha1 arguments after
+<p>The refname value is relative to $GIT_DIR; e.g. for the master
+head this is "refs/heads/master". The two sha1 values before
each refname are the object names for the refname before and after
sha1-old and sha1-new should be valid objects in the repository.</p>
<p>This hook is called before any refname is updated and before any
@@ -349,14 +349,15 @@ this hook. Consider using the post-receive hook instead.</p> <div class="sectionbody">
<p>After all refs were updated (or attempted to be updated), if any
ref update was successful, and if $GIT_DIR/hooks/post-receive
-file exists and is executable, it will be invoke once with three
-parameters for each successfully updated ref:</p>
+file exists and is executable, it will be invoke once with no
+parameters. The standard input of the hook will be one line
+for each successfully updated ref:</p>
<div class="literalblock">
<div class="content">
-<pre><tt>$GIT_DIR/hooks/post-receive (refname sha1-old sha1-new)+</tt></pre>
+<pre><tt>sha1-old SP sha1-new SP refname LF</tt></pre>
</div></div>
-<p>The refname parameter is relative to $GIT_DIR; e.g. for the master
-head this is "refs/heads/master". The two sha1 arguments after
+<p>The refname value is relative to $GIT_DIR; e.g. for the master
+head this is "refs/heads/master". The two sha1 values before
each refname are the object names for the refname before and after
the update. Refs that were created will have sha1-old equal to
the repository.</p>
@@ -367,18 +368,17 @@ ref listing the commits pushed to the repository:</p> <div class="content">
<pre><tt>#!/bin/sh
# mail out commit update information.
-while test $# -gt 0
+while read oval nval ref
do
- if expr "$2" : '0*$' >/dev/null
+ if expr "$oval" : '0*$' >/dev/null
then
echo "Created a new ref, with the following commits:"
- git-rev-list --pretty "$2"
+ git-rev-list --pretty "$nval"
else
echo "New commits:"
- git-rev-list --pretty "$3" "^$2"
+ git-rev-list --pretty "$nval" "^$oval"
fi |
- mail -s "Changes to ref $1" commit-list@mydomain
- shift; shift; shift; # discard this ref's args
+ mail -s "Changes to ref $ref" commit-list@mydomain
done
exit 0</tt></pre>
</div></div>
@@ -425,7 +425,7 @@ exec git-update-server-info</tt></pre> </div>
<div id="footer">
<div id="footer-text">
-Last updated 08-Mar-2007 02:42:38 UTC
+Last updated 12-Mar-2007 07:28:55 UTC
</div>
</div>
</body>
|