1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8" />
6 <meta name=
"generator" content=
"AsciiDoc 8.5.2" />
7 <title>githooks(
5)
</title>
8 <style type=
"text/css">
10 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
12 border: 1px solid red;
17 margin: 1em 5% 1em 5%;
22 text-decoration: underline
;
42 h1
, h2
, h3
, h4
, h5
, h6
{
44 font-family: sans-serif
;
51 border-bottom: 2px solid silver
;
69 border: 1px solid silver
;
88 font-family: sans-serif
;
94 span#revnumber
, span#revdate
, span#revremark
{
95 font-family: sans-serif
;
99 font-family: sans-serif
;
101 border-top: 2px solid silver
;
107 padding-bottom: 0.5em;
111 padding-bottom: 0.5em;
116 margin-bottom: 1.5em;
118 div
.tableblock
, div
.imageblock
, div
.exampleblock
, div
.verseblock
,
119 div
.quoteblock
, div
.literalblock
, div
.listingblock
, div
.sidebarblock
,
120 div
.admonitionblock
{
122 margin-bottom: 1.5em;
124 div
.admonitionblock
{
126 margin-bottom: 2.0em;
131 div
.content
{ /* Block element content. */
135 /* Block element titles. */
136 div
.title
, caption
.title
{
138 font-family: sans-serif
;
142 margin-bottom: 0.5em;
148 td div
.title:first-child
{
151 div
.content div
.title:first-child
{
154 div
.content
+ div
.title
{
158 div
.sidebarblock
> div
.content
{
160 border: 1px solid silver
;
164 div
.listingblock
> div
.content
{
165 border: 1px solid silver
;
170 div
.quoteblock
, div
.verseblock
{
174 border-left: 5px solid
#dddddd;
178 div
.quoteblock
> div
.attribution
{
183 div
.verseblock
> div
.content
{
186 div
.verseblock
> div
.attribution
{
190 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
191 div
.verseblock
+ div
.attribution
{
195 div
.admonitionblock
.icon
{
199 text-decoration: underline
;
201 padding-right: 0.5em;
203 div
.admonitionblock td
.content
{
205 border-left: 3px solid
#dddddd;
208 div
.exampleblock
> div
.content
{
209 border-left: 3px solid
#dddddd;
213 div
.imageblock div
.content
{ padding-left: 0; }
214 span
.image img
{ border-style: none
; }
215 a
.image:visited
{ color: white
; }
219 margin-bottom: 0.8em;
232 list-style-position: outside
;
235 list-style-type: decimal
;
238 list-style-type: lower-alpha
;
241 list-style-type: upper-alpha
;
244 list-style-type: lower-roman
;
247 list-style-type: upper-roman
;
250 div
.compact ul
, div
.compact ol
,
251 div
.compact p
, div
.compact p
,
252 div
.compact div
, div
.compact div
{
254 margin-bottom: 0.1em;
257 div
.tableblock
> table
{
258 border: 3px solid
#527bbd;
260 thead
, p
.table
.header
{
261 font-family: sans-serif
;
273 /* Because the table frame attribute is overriden by CSS in most browsers. */
274 div
.tableblock
> table
[frame
="void"] {
277 div
.tableblock
> table
[frame
="hsides"] {
278 border-left-style: none
;
279 border-right-style: none
;
281 div
.tableblock
> table
[frame
="vsides"] {
282 border-top-style: none
;
283 border-bottom-style: none
;
289 margin-bottom: 0.8em;
292 padding-bottom: 15px;
294 dt
.hdlist1
.strong
, td
.hdlist1
.strong
{
300 padding-right: 0.8em;
306 div
.hdlist
.compact tr
{
315 .footnote, .footnoteref {
319 span
.footnote
, span
.footnoteref
{
320 vertical-align: super
;
324 margin: 20px 0 20px 0;
328 #footnotes div
.footnote
{
334 border-top: 1px solid silver
;
344 div#footer-badges
{ display: none
; }
348 margin-bottom: 2.5em;
353 font-family: sans-serif
;
357 margin-bottom: 0.1em;
360 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
376 /* Overrides for manpage documents */
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver
;
381 border-bottom: 2px solid silver
;
391 div#toc
{ display: none
; }
394 /* Workarounds for IE6's broken and incomplete CSS2. */
396 div
.sidebar-content
{
398 border: 1px solid silver
;
401 div
.sidebar-title
, div
.image-title
{
403 font-family: sans-serif
;
406 margin-bottom: 0.5em;
409 div
.listingblock div
.content
{
410 border: 1px solid silver
;
415 div
.quoteblock-attribution
{
420 div
.verseblock-content
{
423 div
.verseblock-attribution
{
428 div
.exampleblock-content
{
429 border-left: 3px solid
#dddddd;
433 /* IE6 sets dynamically generated links as visited. */
434 div#toc
a:visited
{ color: blue
; }
436 <script type=
"text/javascript">
438 window
.onload = function(){asciidoc
.footnotes();}
439 var asciidoc
= { // Namespace.
441 /////////////////////////////////////////////////////////////////////
442 // Table Of Contents generator
443 /////////////////////////////////////////////////////////////////////
445 /* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
448 * Table Of Content generator
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
459 toc: function (toclevels
) {
461 function getText(el
) {
463 for (var i
= el
.firstChild
; i
!= null; i
= i
.nextSibling
) {
464 if (i
.nodeType
== 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
466 else if (i
.firstChild
!= null)
472 function TocEntry(el
, text
, toclevel
) {
475 this.toclevel
= toclevel
;
478 function tocEntries(el
, toclevels
) {
479 var result
= new Array
;
480 var re
= new RegExp('[hH]([2-'+(toclevels
+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
484 var iterate = function (el
) {
485 for (var i
= el
.firstChild
; i
!= null; i
= i
.nextSibling
) {
486 if (i
.nodeType
== 1 /* Node.ELEMENT_NODE */) {
487 var mo
= re
.exec(i
.tagName
);
488 if (mo
&& (i
.getAttribute("class") || i
.getAttribute("className")) != "float") {
489 result
[result
.length
] = new TocEntry(i
, getText(i
), mo
[1]-1);
499 var toc
= document
.getElementById("toc");
500 var entries
= tocEntries(document
.getElementById("content"), toclevels
);
501 for (var i
= 0; i
< entries
.length
; ++i
) {
502 var entry
= entries
[i
];
503 if (entry
.element
.id
== "")
504 entry
.element
.id
= "_toc_" + i
;
505 var a
= document
.createElement("a");
506 a
.href
= "#" + entry
.element
.id
;
507 a
.appendChild(document
.createTextNode(entry
.text
));
508 var div
= document
.createElement("div");
510 div
.className
= "toclevel" + entry
.toclevel
;
511 toc
.appendChild(div
);
513 if (entries
.length
== 0)
514 toc
.parentNode
.removeChild(toc
);
518 /////////////////////////////////////////////////////////////////////
519 // Footnotes generator
520 /////////////////////////////////////////////////////////////////////
522 /* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
526 footnotes: function () {
527 var cont
= document
.getElementById("content");
528 var noteholder
= document
.getElementById("footnotes");
529 var spans
= cont
.getElementsByTagName("span");
532 for (i
=0; i
<spans
.length
; i
++) {
533 if (spans
[i
].className
== "footnote") {
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note
= spans
[i
].innerHTML
.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder
.innerHTML
+=
539 "<div class='footnote' id='_footnote_" + n
+ "'>" +
540 "<a href='#_footnoteref_" + n
+ "' title='Return to text'>" +
541 n
+ "</a>. " + note
+ "</div>";
543 "[<a id='_footnoteref_" + n
+ "' href='#_footnote_" + n
+
544 "' title='View footnote' class='footnote'>" + n
+ "</a>]";
545 var id
=spans
[i
].getAttribute("id");
546 if (id
!= null) refs
["#"+id
] = n
;
550 noteholder
.parentNode
.removeChild(noteholder
);
552 // Process footnoterefs.
553 for (i
=0; i
<spans
.length
; i
++) {
554 if (spans
[i
].className
== "footnoteref") {
555 var href
= spans
[i
].getElementsByTagName("a")[0].getAttribute("href");
556 href
= href
.match(/#.*/)[0]; // Because IE return full URL.
559 "[<a href='#_footnote_" + n
+
560 "' title='View footnote' class='footnote'>" + n
+ "</a>]";
573 githooks(
5) Manual Page
576 <div class=
"sectionbody">
583 <h2 id=
"_synopsis">SYNOPSIS
</h2>
584 <div class=
"sectionbody">
585 <div class=
"paragraph"><p>$GIT_DIR/hooks/*
</p></div>
587 <h2 id=
"_description">DESCRIPTION
</h2>
588 <div class=
"sectionbody">
589 <div class=
"paragraph"><p>Hooks are little scripts you can place in
<tt>$GIT_DIR/hooks
</tt>
590 directory to trigger action at certain points. When
591 <em>git init
</em> is run, a handful of example hooks are copied into the
592 <tt>hooks
</tt> directory of the new repository, but by default they are
593 all disabled. To enable a hook, rename it by removing its
<tt>.sample
</tt>
595 <div class=
"admonitionblock">
598 <div class=
"title">Note
</div>
600 <td class=
"content">It is also a requirement for a given hook to be executable.
601 However - in a freshly initialized repository - the
<tt>.sample
</tt> files are
602 executable by default.
</td>
605 <div class=
"paragraph"><p>This document describes the currently defined hooks.
</p></div>
607 <h2 id=
"_hooks">HOOKS
</h2>
608 <div class=
"sectionbody">
609 <h3 id=
"_applypatch_msg">applypatch-msg
</h3><div style=
"clear:left"></div>
610 <div class=
"paragraph"><p>This hook is invoked by
<em>git am
</em> script. It takes a single
611 parameter, the name of the file that holds the proposed commit
612 log message. Exiting with non-zero status causes
613 <em>git am
</em> to abort before applying the patch.
</p></div>
614 <div class=
"paragraph"><p>The hook is allowed to edit the message file in place, and can
615 be used to normalize the message into some project standard
616 format (if the project has one). It can also be used to refuse
617 the commit after inspecting the message file.
</p></div>
618 <div class=
"paragraph"><p>The default
<em>applypatch-msg
</em> hook, when enabled, runs the
619 <em>commit-msg
</em> hook, if the latter is enabled.
</p></div>
620 <h3 id=
"_pre_applypatch">pre-applypatch
</h3><div style=
"clear:left"></div>
621 <div class=
"paragraph"><p>This hook is invoked by
<em>git am
</em>. It takes no parameter, and is
622 invoked after the patch is applied, but before a commit is made.
</p></div>
623 <div class=
"paragraph"><p>If it exits with non-zero status, then the working tree will not be
624 committed after applying the patch.
</p></div>
625 <div class=
"paragraph"><p>It can be used to inspect the current working tree and refuse to
626 make a commit if it does not pass certain test.
</p></div>
627 <div class=
"paragraph"><p>The default
<em>pre-applypatch
</em> hook, when enabled, runs the
628 <em>pre-commit
</em> hook, if the latter is enabled.
</p></div>
629 <h3 id=
"_post_applypatch">post-applypatch
</h3><div style=
"clear:left"></div>
630 <div class=
"paragraph"><p>This hook is invoked by
<em>git am
</em>. It takes no parameter,
631 and is invoked after the patch is applied and a commit is made.
</p></div>
632 <div class=
"paragraph"><p>This hook is meant primarily for notification, and cannot affect
633 the outcome of
<em>git am
</em>.
</p></div>
634 <h3 id=
"_pre_commit">pre-commit
</h3><div style=
"clear:left"></div>
635 <div class=
"paragraph"><p>This hook is invoked by
<em>git commit
</em>, and can be bypassed
636 with
<tt>--no-verify
</tt> option. It takes no parameter, and is
637 invoked before obtaining the proposed commit log message and
638 making a commit. Exiting with non-zero status from this script
639 causes the
<em>git commit
</em> to abort.
</p></div>
640 <div class=
"paragraph"><p>The default
<em>pre-commit
</em> hook, when enabled, catches introduction
641 of lines with trailing whitespaces and aborts the commit when
642 such a line is found.
</p></div>
643 <div class=
"paragraph"><p>All the
<em>git commit
</em> hooks are invoked with the environment
644 variable
<tt>GIT_EDITOR=:
</tt> if the command will not bring up an editor
645 to modify the commit message.
</p></div>
646 <h3 id=
"_prepare_commit_msg">prepare-commit-msg
</h3><div style=
"clear:left"></div>
647 <div class=
"paragraph"><p>This hook is invoked by
<em>git commit
</em> right after preparing the
648 default log message, and before the editor is started.
</p></div>
649 <div class=
"paragraph"><p>It takes one to three parameters. The first is the name of the file
650 that contains the commit log message. The second is the source of the commit
651 message, and can be:
<tt>message
</tt> (if a
<tt>-m
</tt> or
<tt>-F
</tt> option was
652 given);
<tt>template
</tt> (if a
<tt>-t
</tt> option was given or the
653 configuration option
<tt>commit.template
</tt> is set);
<tt>merge
</tt> (if the
654 commit is a merge or a
<tt>.git/MERGE_MSG
</tt> file exists);
<tt>squash
</tt>
655 (if a
<tt>.git/SQUASH_MSG
</tt> file exists); or
<tt>commit
</tt>, followed by
656 a commit SHA1 (if a
<tt>-c
</tt>,
<tt>-C
</tt> or
<tt>--amend
</tt> option was given).
</p></div>
657 <div class=
"paragraph"><p>If the exit status is non-zero,
<em>git commit
</em> will abort.
</p></div>
658 <div class=
"paragraph"><p>The purpose of the hook is to edit the message file in place, and
659 it is not suppressed by the
<tt>--no-verify
</tt> option. A non-zero exit
660 means a failure of the hook and aborts the commit. It should not
661 be used as replacement for pre-commit hook.
</p></div>
662 <div class=
"paragraph"><p>The sample
<tt>prepare-commit-msg
</tt> hook that comes with git comments
663 out the
<tt>Conflicts:
</tt> part of a merge
’s commit message.
</p></div>
664 <h3 id=
"_commit_msg">commit-msg
</h3><div style=
"clear:left"></div>
665 <div class=
"paragraph"><p>This hook is invoked by
<em>git commit
</em>, and can be bypassed
666 with
<tt>--no-verify
</tt> option. It takes a single parameter, the
667 name of the file that holds the proposed commit log message.
668 Exiting with non-zero status causes the
<em>git commit
</em> to
670 <div class=
"paragraph"><p>The hook is allowed to edit the message file in place, and can
671 be used to normalize the message into some project standard
672 format (if the project has one). It can also be used to refuse
673 the commit after inspecting the message file.
</p></div>
674 <div class=
"paragraph"><p>The default
<em>commit-msg
</em> hook, when enabled, detects duplicate
675 "Signed-off-by" lines, and aborts the commit if one is found.
</p></div>
676 <h3 id=
"_post_commit">post-commit
</h3><div style=
"clear:left"></div>
677 <div class=
"paragraph"><p>This hook is invoked by
<em>git commit
</em>. It takes no
678 parameter, and is invoked after a commit is made.
</p></div>
679 <div class=
"paragraph"><p>This hook is meant primarily for notification, and cannot affect
680 the outcome of
<em>git commit
</em>.
</p></div>
681 <h3 id=
"_pre_rebase">pre-rebase
</h3><div style=
"clear:left"></div>
682 <div class=
"paragraph"><p>This hook is called by
<em>git rebase
</em> and can be used to prevent a branch
683 from getting rebased.
</p></div>
684 <h3 id=
"_post_checkout">post-checkout
</h3><div style=
"clear:left"></div>
685 <div class=
"paragraph"><p>This hook is invoked when a
<em>git checkout
</em> is run after having updated the
686 worktree. The hook is given three parameters: the ref of the previous HEAD,
687 the ref of the new HEAD (which may or may not have changed), and a flag
688 indicating whether the checkout was a branch checkout (changing branches,
689 flag=
1) or a file checkout (retrieving a file from the index, flag=
0).
690 This hook cannot affect the outcome of
<em>git checkout
</em>.
</p></div>
691 <div class=
"paragraph"><p>It is also run after
<em>git clone
</em>, unless the --no-checkout (-n) option is
692 used. The first parameter given to the hook is the null-ref, the second the
693 ref of the new HEAD and the flag is always
1.
</p></div>
694 <div class=
"paragraph"><p>This hook can be used to perform repository validity checks, auto-display
695 differences from the previous HEAD if different, or set working dir metadata
696 properties.
</p></div>
697 <h3 id=
"_post_merge">post-merge
</h3><div style=
"clear:left"></div>
698 <div class=
"paragraph"><p>This hook is invoked by
<em>git merge
</em>, which happens when a
<em>git pull
</em>
699 is done on a local repository. The hook takes a single parameter, a status
700 flag specifying whether or not the merge being done was a squash merge.
701 This hook cannot affect the outcome of
<em>git merge
</em> and is not executed,
702 if the merge failed due to conflicts.
</p></div>
703 <div class=
"paragraph"><p>This hook can be used in conjunction with a corresponding pre-commit hook to
704 save and restore any form of metadata associated with the working tree
705 (eg: permissions/ownership, ACLS, etc). See contrib/hooks/setgitperms.perl
706 for an example of how to do this.
</p></div>
707 <h3 id=
"pre-receive">pre-receive
</h3><div style=
"clear:left"></div>
708 <div class=
"paragraph"><p>This hook is invoked by
<em>git-receive-pack
</em> on the remote repository,
709 which happens when a
<em>git push
</em> is done on a local repository.
710 Just before starting to update refs on the remote repository, the
711 pre-receive hook is invoked. Its exit status determines the success
712 or failure of the update.
</p></div>
713 <div class=
"paragraph"><p>This hook executes once for the receive operation. It takes no
714 arguments, but for each ref to be updated it receives on standard
715 input a line of the format:
</p></div>
716 <div class=
"literalblock">
717 <div class=
"content">
718 <pre><tt><old-value
> SP
<new-value
> SP
<ref-name
> LF
</tt></pre>
720 <div class=
"paragraph"><p>where
<tt><old-value
></tt> is the old object name stored in the ref,
721 <tt><new-value
></tt> is the new object name to be stored in the ref and
722 <tt><ref-name
></tt> is the full name of the ref.
723 When creating a new ref,
<tt><old-value
></tt> is
40 <tt>0</tt>.
</p></div>
724 <div class=
"paragraph"><p>If the hook exits with non-zero status, none of the refs will be
725 updated. If the hook exits with zero, updating of individual refs can
726 still be prevented by the
<a href=
"#update"><em>update
</em></a> hook.
</p></div>
727 <div class=
"paragraph"><p>Both standard output and standard error output are forwarded to
728 <em>git send-pack
</em> on the other end, so you can simply
<tt>echo
</tt> messages
729 for the user.
</p></div>
730 <h3 id=
"update">update
</h3><div style=
"clear:left"></div>
731 <div class=
"paragraph"><p>This hook is invoked by
<em>git-receive-pack
</em> on the remote repository,
732 which happens when a
<em>git push
</em> is done on a local repository.
733 Just before updating the ref on the remote repository, the update hook
734 is invoked. Its exit status determines the success or failure of
735 the ref update.
</p></div>
736 <div class=
"paragraph"><p>The hook executes once for each ref to be updated, and takes
737 three parameters:
</p></div>
738 <div class=
"ulist"><ul>
741 the name of the ref being updated,
746 the old object name stored in the ref,
751 and the new objectname to be stored in the ref.
755 <div class=
"paragraph"><p>A zero exit from the update hook allows the ref to be updated.
756 Exiting with a non-zero status prevents
<em>git-receive-pack
</em>
757 from updating that ref.
</p></div>
758 <div class=
"paragraph"><p>This hook can be used to prevent
<em>forced
</em> update on certain refs by
759 making sure that the object name is a commit object that is a
760 descendant of the commit object named by the old object name.
761 That is, to enforce a
"fast-forward only" policy.
</p></div>
762 <div class=
"paragraph"><p>It could also be used to log the old..new status. However, it
763 does not know the entire set of branches, so it would end up
764 firing one e-mail per ref when used naively, though. The
765 <a href=
"#post-receive"><em>post-receive
</em></a> hook is more suited to that.
</p></div>
766 <div class=
"paragraph"><p>Another use suggested on the mailing list is to use this hook to
767 implement access control which is finer grained than the one
768 based on filesystem group.
</p></div>
769 <div class=
"paragraph"><p>Both standard output and standard error output are forwarded to
770 <em>git send-pack
</em> on the other end, so you can simply
<tt>echo
</tt> messages
771 for the user.
</p></div>
772 <div class=
"paragraph"><p>The default
<em>update
</em> hook, when enabled
—and with
773 <tt>hooks.allowunannotated
</tt> config option unset or set to false
—prevents
774 unannotated tags to be pushed.
</p></div>
775 <h3 id=
"post-receive">post-receive
</h3><div style=
"clear:left"></div>
776 <div class=
"paragraph"><p>This hook is invoked by
<em>git-receive-pack
</em> on the remote repository,
777 which happens when a
<em>git push
</em> is done on a local repository.
778 It executes on the remote repository once after all the refs have
779 been updated.
</p></div>
780 <div class=
"paragraph"><p>This hook executes once for the receive operation. It takes no
781 arguments, but gets the same information as the
782 <a href=
"#pre-receive"><em>pre-receive
</em></a>
783 hook does on its standard input.
</p></div>
784 <div class=
"paragraph"><p>This hook does not affect the outcome of
<em>git-receive-pack
</em>, as it
785 is called after the real work is done.
</p></div>
786 <div class=
"paragraph"><p>This supersedes the
<a href=
"#post-update"><em>post-update
</em></a> hook in that it gets
787 both old and new values of all the refs in addition to their
789 <div class=
"paragraph"><p>Both standard output and standard error output are forwarded to
790 <em>git send-pack
</em> on the other end, so you can simply
<tt>echo
</tt> messages
791 for the user.
</p></div>
792 <div class=
"paragraph"><p>The default
<em>post-receive
</em> hook is empty, but there is
793 a sample script
<tt>post-receive-email
</tt> provided in the
<tt>contrib/hooks
</tt>
794 directory in git distribution, which implements sending commit
796 <h3 id=
"post-update">post-update
</h3><div style=
"clear:left"></div>
797 <div class=
"paragraph"><p>This hook is invoked by
<em>git-receive-pack
</em> on the remote repository,
798 which happens when a
<em>git push
</em> is done on a local repository.
799 It executes on the remote repository once after all the refs have
800 been updated.
</p></div>
801 <div class=
"paragraph"><p>It takes a variable number of parameters, each of which is the
802 name of ref that was actually updated.
</p></div>
803 <div class=
"paragraph"><p>This hook is meant primarily for notification, and cannot affect
804 the outcome of
<em>git-receive-pack
</em>.
</p></div>
805 <div class=
"paragraph"><p>The
<em>post-update
</em> hook can tell what are the heads that were pushed,
806 but it does not know what their original and updated values are,
807 so it is a poor place to do log old..new. The
808 <a href=
"#post-receive"><em>post-receive
</em></a> hook does get both original and
809 updated values of the refs. You might consider it instead if you need
811 <div class=
"paragraph"><p>When enabled, the default
<em>post-update
</em> hook runs
812 <em>git update-server-info
</em> to keep the information used by dumb
813 transports (e.g., HTTP) up-to-date. If you are publishing
814 a git repository that is accessible via HTTP, you should
815 probably enable this hook.
</p></div>
816 <div class=
"paragraph"><p>Both standard output and standard error output are forwarded to
817 <em>git send-pack
</em> on the other end, so you can simply
<tt>echo
</tt> messages
818 for the user.
</p></div>
819 <h3 id=
"_pre_auto_gc">pre-auto-gc
</h3><div style=
"clear:left"></div>
820 <div class=
"paragraph"><p>This hook is invoked by
<em>git gc --auto
</em>. It takes no parameter, and
821 exiting with non-zero status from this script causes the
<em>git gc --auto
</em>
823 <h3 id=
"_post_rewrite">post-rewrite
</h3><div style=
"clear:left"></div>
824 <div class=
"paragraph"><p>This hook is invoked by commands that rewrite commits (
<tt>git commit
825 --amend
</tt>,
<em>git-rebase
</em>; currently
<em>git-filter-branch
</em> does
<em>not
</em> call
826 it!). Its first argument denotes the command it was invoked by:
827 currently one of
<tt>amend
</tt> or
<tt>rebase
</tt>. Further command-dependent
828 arguments may be passed in the future.
</p></div>
829 <div class=
"paragraph"><p>The hook receives a list of the rewritten commits on stdin, in the
831 <div class=
"literalblock">
832 <div class=
"content">
833 <pre><tt><old-sha1
> SP
<new-sha1
> [ SP
<extra-info
> ] LF
</tt></pre>
835 <div class=
"paragraph"><p>The
<em>extra-info
</em> is again command-dependent. If it is empty, the
836 preceding SP is also omitted. Currently, no commands pass any
837 <em>extra-info
</em>.
</p></div>
838 <div class=
"paragraph"><p>The hook always runs after the automatic note copying (see
839 "notes.rewrite.<command>" in linkgit:git-config.txt) has happened, and
840 thus has access to these notes.
</p></div>
841 <div class=
"paragraph"><p>The following command-specific comments apply:
</p></div>
842 <div class=
"dlist"><dl>
848 For the
<em>squash
</em> and
<em>fixup
</em> operation, all commits that were
849 squashed are listed as being rewritten to the squashed commit.
850 This means that there will be several lines sharing the same
853 <div class=
"paragraph"><p>The commits are guaranteed to be listed in the order that they were
854 processed by rebase.
</p></div>
858 <h2 id=
"_git">GIT
</h2>
859 <div class=
"sectionbody">
860 <div class=
"paragraph"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
863 <div id=
"footnotes"><hr /></div>
865 <div id=
"footer-text">
866 Last updated
2011-
09-
21 23:
01:
14 PDT