summaryrefslogtreecommitdiffstats
path: root/githooks.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-01-17 14:46:49 -0800
committerJunio C Hamano <gitster@pobox.com>2014-01-17 14:46:49 -0800
commit61525f915b47e953b4288a9afcee45e47b352214 (patch)
treef0649f89cc7a77c0296305f4673fc2bc7e0a6d54 /githooks.html
parentbc8d4783cac3c942fc9e8cf2f3eae4aea8cab5cb (diff)
downloadgit-htmldocs-61525f915b47e953b4288a9afcee45e47b352214.tar.gz
Autogenerated HTML docs for v1.9-rc0
Diffstat (limited to 'githooks.html')
-rw-r--r--githooks.html108
1 files changed, 56 insertions, 52 deletions
diff --git a/githooks.html b/githooks.html
index 57c61600c..865b12bb6 100644
--- a/githooks.html
+++ b/githooks.html
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
-<meta name="generator" content="AsciiDoc 8.6.8" />
+<meta name="generator" content="AsciiDoc 8.6.6" />
<title>githooks(5)</title>
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
@@ -87,15 +87,11 @@ ul, ol, li > p {
ul > li { color: #aaa; }
ul > li > * { color: black; }
-.monospaced, code, pre {
- font-family: "Courier New", Courier, monospace;
- font-size: inherit;
- color: navy;
+pre {
padding: 0;
margin: 0;
}
-
#author {
color: #527bbd;
font-weight: bold;
@@ -353,7 +349,7 @@ div.colist td img {
margin-bottom: 0.1em;
}
-div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
+div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
margin-top: 0;
margin-bottom: 0;
}
@@ -411,14 +407,18 @@ span.underline { text-decoration: underline; }
span.overline { text-decoration: overline; }
span.line-through { text-decoration: line-through; }
-div.unbreakable { page-break-inside: avoid; }
-
/*
* xhtml11 specific
*
* */
+tt {
+ font-family: monospace;
+ font-size: inherit;
+ color: navy;
+}
+
div.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
@@ -452,6 +452,12 @@ div.tableblock > table[frame="vsides"] {
*
* */
+.monospaced {
+ font-family: monospace;
+ font-size: inherit;
+ color: navy;
+}
+
table.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
@@ -531,8 +537,6 @@ body.manpage div.sectionbody {
@media print {
body.manpage div#toc { display: none; }
}
-
-
</style>
<script type="text/javascript">
/*<![CDATA[*/
@@ -577,7 +581,7 @@ toc: function (toclevels) {
function tocEntries(el, toclevels) {
var result = new Array;
- var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
+ var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
// Function that scans the DOM tree for header elements (the DOM2
// nodeIterator API would be a better technique but not supported by all
// browsers).
@@ -606,7 +610,7 @@ toc: function (toclevels) {
var i;
for (i = 0; i < toc.childNodes.length; i++) {
var entry = toc.childNodes[i];
- if (entry.nodeName.toLowerCase() == 'div'
+ if (entry.nodeName == 'div'
&& entry.getAttribute("class")
&& entry.getAttribute("class").match(/^toclevel/))
tocEntriesToRemove.push(entry);
@@ -652,7 +656,7 @@ footnotes: function () {
var entriesToRemove = [];
for (i = 0; i < noteholder.childNodes.length; i++) {
var entry = noteholder.childNodes[i];
- if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
+ if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")
entriesToRemove.push(entry);
}
for (i = 0; i < entriesToRemove.length; i++) {
@@ -751,11 +755,11 @@ githooks(5) Manual Page
<div class="sect1">
<h2 id="_description">DESCRIPTION</h2>
<div class="sectionbody">
-<div class="paragraph"><p>Hooks are little scripts you can place in <code>$GIT_DIR/hooks</code>
+<div class="paragraph"><p>Hooks are little scripts you can place in <tt>$GIT_DIR/hooks</tt>
directory to trigger action at certain points. When
<em>git init</em> is run, a handful of example hooks are copied into the
-<code>hooks</code> directory of the new repository, but by default they are
-all disabled. To enable a hook, rename it by removing its <code>.sample</code>
+<tt>hooks</tt> directory of the new repository, but by default they are
+all disabled. To enable a hook, rename it by removing its <tt>.sample</tt>
suffix.</p></div>
<div class="admonitionblock">
<table><tr>
@@ -763,7 +767,7 @@ suffix.</p></div>
<div class="title">Note</div>
</td>
<td class="content">It is also a requirement for a given hook to be executable.
-However - in a freshly initialized repository - the <code>.sample</code> files are
+However - in a freshly initialized repository - the <tt>.sample</tt> files are
executable by default.</td>
</tr></table>
</div>
@@ -807,7 +811,7 @@ the outcome of <em>git am</em>.</p></div>
<div class="sect2">
<h3 id="_pre_commit">pre-commit</h3>
<div class="paragraph"><p>This hook is invoked by <em>git commit</em>, and can be bypassed
-with <code>--no-verify</code> option. It takes no parameter, and is
+with <tt>--no-verify</tt> option. It takes no parameter, and is
invoked before obtaining the proposed commit log message and
making a commit. Exiting with non-zero status from this script
causes the <em>git commit</em> to abort.</p></div>
@@ -815,7 +819,7 @@ causes the <em>git commit</em> to abort.</p></div>
of lines with trailing whitespaces and aborts the commit when
such a line is found.</p></div>
<div class="paragraph"><p>All the <em>git commit</em> hooks are invoked with the environment
-variable <code>GIT_EDITOR=:</code> if the command will not bring up an editor
+variable <tt>GIT_EDITOR=:</tt> if the command will not bring up an editor
to modify the commit message.</p></div>
</div>
<div class="sect2">
@@ -824,24 +828,24 @@ to modify the commit message.</p></div>
default log message, and before the editor is started.</p></div>
<div class="paragraph"><p>It takes one to three parameters. The first is the name of the file
that contains the commit log message. The second is the source of the commit
-message, and can be: <code>message</code> (if a <code>-m</code> or <code>-F</code> option was
-given); <code>template</code> (if a <code>-t</code> option was given or the
-configuration option <code>commit.template</code> is set); <code>merge</code> (if the
-commit is a merge or a <code>.git/MERGE_MSG</code> file exists); <code>squash</code>
-(if a <code>.git/SQUASH_MSG</code> file exists); or <code>commit</code>, followed by
-a commit SHA-1 (if a <code>-c</code>, <code>-C</code> or <code>--amend</code> option was given).</p></div>
+message, and can be: <tt>message</tt> (if a <tt>-m</tt> or <tt>-F</tt> option was
+given); <tt>template</tt> (if a <tt>-t</tt> option was given or the
+configuration option <tt>commit.template</tt> is set); <tt>merge</tt> (if the
+commit is a merge or a <tt>.git/MERGE_MSG</tt> file exists); <tt>squash</tt>
+(if a <tt>.git/SQUASH_MSG</tt> file exists); or <tt>commit</tt>, followed by
+a commit SHA-1 (if a <tt>-c</tt>, <tt>-C</tt> or <tt>--amend</tt> option was given).</p></div>
<div class="paragraph"><p>If the exit status is non-zero, <em>git commit</em> will abort.</p></div>
<div class="paragraph"><p>The purpose of the hook is to edit the message file in place, and
-it is not suppressed by the <code>--no-verify</code> option. A non-zero exit
+it is not suppressed by the <tt>--no-verify</tt> option. A non-zero exit
means a failure of the hook and aborts the commit. It should not
be used as replacement for pre-commit hook.</p></div>
-<div class="paragraph"><p>The sample <code>prepare-commit-msg</code> hook that comes with Git comments
-out the <code>Conflicts:</code> part of a merge&#8217;s commit message.</p></div>
+<div class="paragraph"><p>The sample <tt>prepare-commit-msg</tt> hook that comes with Git comments
+out the <tt>Conflicts:</tt> part of a merge&#8217;s commit message.</p></div>
</div>
<div class="sect2">
<h3 id="_commit_msg">commit-msg</h3>
<div class="paragraph"><p>This hook is invoked by <em>git commit</em>, and can be bypassed
-with <code>--no-verify</code> option. It takes a single parameter, the
+with <tt>--no-verify</tt> option. It takes a single parameter, the
name of the file that holds the proposed commit log message.
Exiting with non-zero status causes the <em>git commit</em> to
abort.</p></div>
@@ -904,19 +908,19 @@ values will be the same.</p></div>
input with lines of the form:</p></div>
<div class="literalblock">
<div class="content">
-<pre><code>&lt;local ref&gt; SP &lt;local sha1&gt; SP &lt;remote ref&gt; SP &lt;remote sha1&gt; LF</code></pre>
+<pre><tt>&lt;local ref&gt; SP &lt;local sha1&gt; SP &lt;remote ref&gt; SP &lt;remote sha1&gt; LF</tt></pre>
</div></div>
-<div class="paragraph"><p>For instance, if the command <code>git push origin master:foreign</code> were run the
+<div class="paragraph"><p>For instance, if the command <tt>git push origin master:foreign</tt> were run the
hook would receive a line like the following:</p></div>
<div class="literalblock">
<div class="content">
-<pre><code>refs/heads/master 67890 refs/heads/foreign 12345</code></pre>
+<pre><tt>refs/heads/master 67890 refs/heads/foreign 12345</tt></pre>
</div></div>
<div class="paragraph"><p>although the full, 40-character SHA-1s would be supplied. If the foreign ref
-does not yet exist the <code>&lt;remote SHA-1&gt;</code> will be 40 <code>0</code>. If a ref is to be
-deleted, the <code>&lt;local ref&gt;</code> will be supplied as <code>(delete)</code> and the <code>&lt;local
-SHA-1&gt;</code> will be 40 <code>0</code>. If the local commit was specified by something other
-than a name which could be expanded (such as <code>HEAD~</code>, or a SHA-1) it will be
+does not yet exist the <tt>&lt;remote SHA-1&gt;</tt> will be 40 <tt>0</tt>. If a ref is to be
+deleted, the <tt>&lt;local ref&gt;</tt> will be supplied as <tt>(delete)</tt> and the <tt>&lt;local
+SHA-1&gt;</tt> will be 40 <tt>0</tt>. If the local commit was specified by something other
+than a name which could be expanded (such as <tt>HEAD~</tt>, or a SHA-1) it will be
supplied as it was originally given.</p></div>
<div class="paragraph"><p>If this hook exits with a non-zero status, <em>git push</em> will abort without
pushing anything. Information about why the push is rejected may be sent
@@ -934,17 +938,17 @@ arguments, but for each ref to be updated it receives on standard
input a line of the format:</p></div>
<div class="literalblock">
<div class="content">
-<pre><code>&lt;old-value&gt; SP &lt;new-value&gt; SP &lt;ref-name&gt; LF</code></pre>
+<pre><tt>&lt;old-value&gt; SP &lt;new-value&gt; SP &lt;ref-name&gt; LF</tt></pre>
</div></div>
-<div class="paragraph"><p>where <code>&lt;old-value&gt;</code> is the old object name stored in the ref,
-<code>&lt;new-value&gt;</code> is the new object name to be stored in the ref and
-<code>&lt;ref-name&gt;</code> is the full name of the ref.
-When creating a new ref, <code>&lt;old-value&gt;</code> is 40 <code>0</code>.</p></div>
+<div class="paragraph"><p>where <tt>&lt;old-value&gt;</tt> is the old object name stored in the ref,
+<tt>&lt;new-value&gt;</tt> is the new object name to be stored in the ref and
+<tt>&lt;ref-name&gt;</tt> is the full name of the ref.
+When creating a new ref, <tt>&lt;old-value&gt;</tt> is 40 <tt>0</tt>.</p></div>
<div class="paragraph"><p>If the hook exits with non-zero status, none of the refs will be
updated. If the hook exits with zero, updating of individual refs can
still be prevented by the <a href="#update"><em>update</em></a> hook.</p></div>
<div class="paragraph"><p>Both standard output and standard error output are forwarded to
-<em>git send-pack</em> on the other end, so you can simply <code>echo</code> messages
+<em>git send-pack</em> on the other end, so you can simply <tt>echo</tt> messages
for the user.</p></div>
</div>
<div class="sect2">
@@ -988,10 +992,10 @@ firing one e-mail per ref when used naively, though. The
implement access control which is finer grained than the one
based on filesystem group.</p></div>
<div class="paragraph"><p>Both standard output and standard error output are forwarded to
-<em>git send-pack</em> on the other end, so you can simply <code>echo</code> messages
+<em>git send-pack</em> on the other end, so you can simply <tt>echo</tt> messages
for the user.</p></div>
<div class="paragraph"><p>The default <em>update</em> hook, when enabled&#8212;and with
-<code>hooks.allowunannotated</code> config option unset or set to false&#8212;prevents
+<tt>hooks.allowunannotated</tt> config option unset or set to false&#8212;prevents
unannotated tags to be pushed.</p></div>
</div>
<div class="sect2">
@@ -1010,10 +1014,10 @@ is called after the real work is done.</p></div>
both old and new values of all the refs in addition to their
names.</p></div>
<div class="paragraph"><p>Both standard output and standard error output are forwarded to
-<em>git send-pack</em> on the other end, so you can simply <code>echo</code> messages
+<em>git send-pack</em> on the other end, so you can simply <tt>echo</tt> messages
for the user.</p></div>
<div class="paragraph"><p>The default <em>post-receive</em> hook is empty, but there is
-a sample script <code>post-receive-email</code> provided in the <code>contrib/hooks</code>
+a sample script <tt>post-receive-email</tt> provided in the <tt>contrib/hooks</tt>
directory in Git distribution, which implements sending commit
emails.</p></div>
</div>
@@ -1039,7 +1043,7 @@ transports (e.g., HTTP) up-to-date. If you are publishing
a Git repository that is accessible via HTTP, you should
probably enable this hook.</p></div>
<div class="paragraph"><p>Both standard output and standard error output are forwarded to
-<em>git send-pack</em> on the other end, so you can simply <code>echo</code> messages
+<em>git send-pack</em> on the other end, so you can simply <tt>echo</tt> messages
for the user.</p></div>
</div>
<div class="sect2">
@@ -1050,16 +1054,16 @@ to abort.</p></div>
</div>
<div class="sect2">
<h3 id="_post_rewrite">post-rewrite</h3>
-<div class="paragraph"><p>This hook is invoked by commands that rewrite commits (<code>git commit
---amend</code>, <em>git-rebase</em>; currently <em>git-filter-branch</em> does <em>not</em> call
+<div class="paragraph"><p>This hook is invoked by commands that rewrite commits (<tt>git commit
+--amend</tt>, <em>git-rebase</em>; currently <em>git-filter-branch</em> does <em>not</em> call
it!). Its first argument denotes the command it was invoked by:
-currently one of <code>amend</code> or <code>rebase</code>. Further command-dependent
+currently one of <tt>amend</tt> or <tt>rebase</tt>. Further command-dependent
arguments may be passed in the future.</p></div>
<div class="paragraph"><p>The hook receives a list of the rewritten commits on stdin, in the
format</p></div>
<div class="literalblock">
<div class="content">
-<pre><code>&lt;old-sha1&gt; SP &lt;new-sha1&gt; [ SP &lt;extra-info&gt; ] LF</code></pre>
+<pre><tt>&lt;old-sha1&gt; SP &lt;new-sha1&gt; [ SP &lt;extra-info&gt; ] LF</tt></pre>
</div></div>
<div class="paragraph"><p>The <em>extra-info</em> is again command-dependent. If it is empty, the
preceding SP is also omitted. Currently, no commands pass any