summaryrefslogtreecommitdiffstats
path: root/githooks.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-10-31 13:25:53 -0700
committerJunio C Hamano <gitster@pobox.com>2014-10-31 13:25:53 -0700
commitc14e6ad9a230ad90c84b7f620d87fbe49a2d0342 (patch)
tree120346dc383e3d1c4219fe8c533eb22cb6af2b55 /githooks.html
parent2a4bcbc355496c8d83b1b9f8892c4cbe8f584158 (diff)
downloadgit-htmldocs-c14e6ad9a230ad90c84b7f620d87fbe49a2d0342.tar.gz
Autogenerated HTML docs for v2.2.0-rc0
Diffstat (limited to 'githooks.html')
-rw-r--r--githooks.html112
1 files changed, 55 insertions, 57 deletions
diff --git a/githooks.html b/githooks.html
index ebae558fe..02a23b08a 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.6" />
+<meta name="generator" content="AsciiDoc 8.6.9" />
<title>githooks(5)</title>
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
@@ -87,10 +87,16 @@ ul, ol, li > p {
ul > li { color: #aaa; }
ul > li > * { color: black; }
-pre {
+.monospaced, code, pre {
+ font-family: "Courier New", Courier, monospace;
+ font-size: inherit;
+ color: navy;
padding: 0;
margin: 0;
}
+pre {
+ white-space: pre-wrap;
+}
#author {
color: #527bbd;
@@ -219,7 +225,7 @@ div.exampleblock > div.content {
}
div.imageblock div.content { padding-left: 0; }
-span.image img { border-style: none; }
+span.image img { border-style: none; vertical-align: text-bottom; }
a.image:visited { color: white; }
dl {
@@ -349,7 +355,7 @@ div.colist td img {
margin-bottom: 0.1em;
}
-div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
+div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
margin-top: 0;
margin-bottom: 0;
}
@@ -407,18 +413,14 @@ 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,12 +454,6 @@ div.tableblock > table[frame="vsides"] {
*
* */
-.monospaced {
- font-family: monospace;
- font-size: inherit;
- color: navy;
-}
-
table.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
@@ -537,6 +533,8 @@ body.manpage div.sectionbody {
@media print {
body.manpage div#toc { display: none; }
}
+
+
</style>
<script type="text/javascript">
/*<![CDATA[*/
@@ -581,7 +579,7 @@ toc: function (toclevels) {
function tocEntries(el, toclevels) {
var result = new Array;
- var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
+ var re = new RegExp('[hH]([1-'+(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).
@@ -610,7 +608,7 @@ toc: function (toclevels) {
var i;
for (i = 0; i < toc.childNodes.length; i++) {
var entry = toc.childNodes[i];
- if (entry.nodeName == 'div'
+ if (entry.nodeName.toLowerCase() == 'div'
&& entry.getAttribute("class")
&& entry.getAttribute("class").match(/^toclevel/))
tocEntriesToRemove.push(entry);
@@ -656,7 +654,7 @@ footnotes: function () {
var entriesToRemove = [];
for (i = 0; i < noteholder.childNodes.length; i++) {
var entry = noteholder.childNodes[i];
- if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")
+ if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
entriesToRemove.push(entry);
}
for (i = 0; i < entriesToRemove.length; i++) {
@@ -755,11 +753,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 <tt>$GIT_DIR/hooks</tt>
+<div class="paragraph"><p>Hooks are little scripts you can place in <code>$GIT_DIR/hooks</code>
directory to trigger action at certain points. When
<em>git init</em> is run, a handful of example hooks are copied into the
-<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>
+<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>
suffix.</p></div>
<div class="admonitionblock">
<table><tr>
@@ -767,7 +765,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 <tt>.sample</tt> files are
+However - in a freshly initialized repository - the <code>.sample</code> files are
executable by default.</td>
</tr></table>
</div>
@@ -811,7 +809,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 <tt>--no-verify</tt> option. It takes no parameter, and is
+with <code>--no-verify</code> 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>
@@ -819,7 +817,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 <tt>GIT_EDITOR=:</tt> if the command will not bring up an editor
+variable <code>GIT_EDITOR=:</code> if the command will not bring up an editor
to modify the commit message.</p></div>
</div>
<div class="sect2">
@@ -828,24 +826,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: <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>
+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>
<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 <tt>--no-verify</tt> option. A non-zero exit
+it is not suppressed by the <code>--no-verify</code> 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 <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 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>
<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 <tt>--no-verify</tt> option. It takes a single parameter, the
+with <code>--no-verify</code> 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>
@@ -908,19 +906,19 @@ values will be the same.</p></div>
input with lines of the form:</p></div>
<div class="literalblock">
<div class="content">
-<pre><tt>&lt;local ref&gt; SP &lt;local sha1&gt; SP &lt;remote ref&gt; SP &lt;remote sha1&gt; LF</tt></pre>
+<pre><code>&lt;local ref&gt; SP &lt;local sha1&gt; SP &lt;remote ref&gt; SP &lt;remote sha1&gt; LF</code></pre>
</div></div>
-<div class="paragraph"><p>For instance, if the command <tt>git push origin master:foreign</tt> were run the
+<div class="paragraph"><p>For instance, if the command <code>git push origin master:foreign</code> were run the
hook would receive a line like the following:</p></div>
<div class="literalblock">
<div class="content">
-<pre><tt>refs/heads/master 67890 refs/heads/foreign 12345</tt></pre>
+<pre><code>refs/heads/master 67890 refs/heads/foreign 12345</code></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 <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
+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
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
@@ -938,17 +936,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><tt>&lt;old-value&gt; SP &lt;new-value&gt; SP &lt;ref-name&gt; LF</tt></pre>
+<pre><code>&lt;old-value&gt; SP &lt;new-value&gt; SP &lt;ref-name&gt; LF</code></pre>
</div></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>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>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 <tt>echo</tt> messages
+<em>git send-pack</em> on the other end, so you can simply <code>echo</code> messages
for the user.</p></div>
</div>
<div class="sect2">
@@ -992,10 +990,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 <tt>echo</tt> messages
+<em>git send-pack</em> on the other end, so you can simply <code>echo</code> messages
for the user.</p></div>
<div class="paragraph"><p>The default <em>update</em> hook, when enabled&#8212;and with
-<tt>hooks.allowunannotated</tt> config option unset or set to false&#8212;prevents
+<code>hooks.allowunannotated</code> config option unset or set to false&#8212;prevents
unannotated tags to be pushed.</p></div>
</div>
<div class="sect2">
@@ -1014,10 +1012,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 <tt>echo</tt> messages
+<em>git send-pack</em> on the other end, so you can simply <code>echo</code> 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 <tt>post-receive-email</tt> provided in the <tt>contrib/hooks</tt>
+a sample script <code>post-receive-email</code> provided in the <code>contrib/hooks</code>
directory in Git distribution, which implements sending commit
emails.</p></div>
</div>
@@ -1043,7 +1041,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 <tt>echo</tt> messages
+<em>git send-pack</em> on the other end, so you can simply <code>echo</code> messages
for the user.</p></div>
</div>
<div class="sect2">
@@ -1054,16 +1052,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 (<tt>git commit
---amend</tt>, <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 (<code>git commit
+--amend</code>, <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 <tt>amend</tt> or <tt>rebase</tt>. Further command-dependent
+currently one of <code>amend</code> or <code>rebase</code>. 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><tt>&lt;old-sha1&gt; SP &lt;new-sha1&gt; [ SP &lt;extra-info&gt; ] LF</tt></pre>
+<pre><code>&lt;old-sha1&gt; SP &lt;new-sha1&gt; [ SP &lt;extra-info&gt; ] LF</code></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