blob: a5867f3ec7d8a3d64f8f563c317c06e7e1610068 [file] [log] [blame]
Junio C Hamanob9d9d902018-05-23 07:07:421<?xml version="1.0" encoding="UTF-8"?>
Junio C Hamano2fbcd212008-05-14 22:26:072<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5<head>
Junio C Hamano9d971152012-12-19 00:43:116<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamano98c882d2020-08-13 22:06:577<meta name="generator" content="AsciiDoc 9.0.0rc2" />
Junio C Hamano81435632011-01-12 09:08:488<title>githooks(5)</title>
Junio C Hamano2fbcd212008-05-14 22:26:079<style type="text/css">
Junio C Hamano9d971152012-12-19 00:43:1110/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
11
12/* Default font. */
13body {
14 font-family: Georgia,serif;
15}
16
17/* Title font. */
18h1, h2, h3, h4, h5, h6,
19div.title, caption.title,
20thead, p.table.header,
21#toctitle,
22#author, #revnumber, #revdate, #revremark,
23#footer {
24 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano2fbcd212008-05-14 22:26:0725}
26
27body {
28 margin: 1em 5% 1em 5%;
29}
30
Junio C Hamanoba4b9282008-07-06 05:20:3131a {
32 color: blue;
33 text-decoration: underline;
34}
35a:visited {
36 color: fuchsia;
37}
Junio C Hamano2fbcd212008-05-14 22:26:0738
39em {
40 font-style: italic;
Junio C Hamano81435632011-01-12 09:08:4841 color: navy;
Junio C Hamano2fbcd212008-05-14 22:26:0742}
43
44strong {
45 font-weight: bold;
Junio C Hamano81435632011-01-12 09:08:4846 color: #083194;
Junio C Hamano2fbcd212008-05-14 22:26:0747}
48
Junio C Hamano2fbcd212008-05-14 22:26:0749h1, h2, h3, h4, h5, h6 {
50 color: #527bbd;
Junio C Hamano2fbcd212008-05-14 22:26:0751 margin-top: 1.2em;
52 margin-bottom: 0.5em;
53 line-height: 1.3;
54}
55
Junio C Hamanoba4b9282008-07-06 05:20:3156h1, h2, h3 {
Junio C Hamano2fbcd212008-05-14 22:26:0757 border-bottom: 2px solid silver;
58}
59h2 {
Junio C Hamano2fbcd212008-05-14 22:26:0760 padding-top: 0.5em;
61}
Junio C Hamanoba4b9282008-07-06 05:20:3162h3 {
63 float: left;
64}
65h3 + * {
66 clear: left;
67}
Junio C Hamano9d971152012-12-19 00:43:1168h5 {
69 font-size: 1.0em;
70}
Junio C Hamano2fbcd212008-05-14 22:26:0771
72div.sectionbody {
Junio C Hamano2fbcd212008-05-14 22:26:0773 margin-left: 0;
74}
75
76hr {
77 border: 1px solid silver;
78}
79
80p {
81 margin-top: 0.5em;
82 margin-bottom: 0.5em;
83}
84
Junio C Hamano81435632011-01-12 09:08:4885ul, ol, li > p {
86 margin-top: 0;
87}
Junio C Hamano9d971152012-12-19 00:43:1188ul > li { color: #aaa; }
89ul > li > * { color: black; }
Junio C Hamano81435632011-01-12 09:08:4890
Junio C Hamanoc14e6ad2014-10-31 20:25:5391.monospaced, code, pre {
92 font-family: "Courier New", Courier, monospace;
93 font-size: inherit;
94 color: navy;
Junio C Hamano2fbcd212008-05-14 22:26:0795 padding: 0;
96 margin: 0;
97}
Junio C Hamanoc14e6ad2014-10-31 20:25:5398pre {
99 white-space: pre-wrap;
100}
Junio C Hamano2fbcd212008-05-14 22:26:07101
Junio C Hamano9d971152012-12-19 00:43:11102#author {
Junio C Hamano2fbcd212008-05-14 22:26:07103 color: #527bbd;
Junio C Hamano2fbcd212008-05-14 22:26:07104 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31105 font-size: 1.1em;
Junio C Hamano2fbcd212008-05-14 22:26:07106}
Junio C Hamano9d971152012-12-19 00:43:11107#email {
Junio C Hamano2fbcd212008-05-14 22:26:07108}
Junio C Hamano9d971152012-12-19 00:43:11109#revnumber, #revdate, #revremark {
Junio C Hamano2fbcd212008-05-14 22:26:07110}
111
Junio C Hamano9d971152012-12-19 00:43:11112#footer {
Junio C Hamano2fbcd212008-05-14 22:26:07113 font-size: small;
114 border-top: 2px solid silver;
115 padding-top: 0.5em;
116 margin-top: 4.0em;
117}
Junio C Hamano9d971152012-12-19 00:43:11118#footer-text {
Junio C Hamano2fbcd212008-05-14 22:26:07119 float: left;
120 padding-bottom: 0.5em;
121}
Junio C Hamano9d971152012-12-19 00:43:11122#footer-badges {
Junio C Hamano2fbcd212008-05-14 22:26:07123 float: right;
124 padding-bottom: 0.5em;
125}
126
Junio C Hamano9d971152012-12-19 00:43:11127#preamble {
Junio C Hamano81435632011-01-12 09:08:48128 margin-top: 1.5em;
129 margin-bottom: 1.5em;
130}
Junio C Hamano9d971152012-12-19 00:43:11131div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano2fbcd212008-05-14 22:26:07132div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22134 margin-top: 1.0em;
Junio C Hamano2fbcd212008-05-14 22:26:07135 margin-bottom: 1.5em;
136}
137div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22138 margin-top: 2.0em;
139 margin-bottom: 2.0em;
140 margin-right: 10%;
141 color: #606060;
Junio C Hamano2fbcd212008-05-14 22:26:07142}
143
144div.content { /* Block element content. */
145 padding: 0;
146}
147
148/* Block element titles. */
149div.title, caption.title {
Junio C Hamano81435632011-01-12 09:08:48150 color: #527bbd;
Junio C Hamano2fbcd212008-05-14 22:26:07151 font-weight: bold;
152 text-align: left;
153 margin-top: 1.0em;
154 margin-bottom: 0.5em;
155}
156div.title + * {
157 margin-top: 0;
158}
159
160td div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content div.title:first-child {
164 margin-top: 0.0em;
165}
166div.content + div.title {
167 margin-top: 0.0em;
168}
169
170div.sidebarblock > div.content {
171 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11172 border: 1px solid #dddddd;
173 border-left: 4px solid #f0f0f0;
Junio C Hamano2fbcd212008-05-14 22:26:07174 padding: 0.5em;
175}
176
177div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11178 border: 1px solid #dddddd;
179 border-left: 5px solid #f0f0f0;
180 background: #f8f8f8;
Junio C Hamano2fbcd212008-05-14 22:26:07181 padding: 0.5em;
182}
183
Junio C Hamano7bd050f2011-09-22 06:32:22184div.quoteblock, div.verseblock {
185 padding-left: 1.0em;
186 margin-left: 1.0em;
Junio C Hamano81435632011-01-12 09:08:48187 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11188 border-left: 5px solid #f0f0f0;
189 color: #888;
Junio C Hamano2fbcd212008-05-14 22:26:07190}
Junio C Hamano7bd050f2011-09-22 06:32:22191
Junio C Hamano81435632011-01-12 09:08:48192div.quoteblock > div.attribution {
193 padding-top: 0.5em;
Junio C Hamano2fbcd212008-05-14 22:26:07194 text-align: right;
195}
Junio C Hamano81435632011-01-12 09:08:48196
Junio C Hamano9d971152012-12-19 00:43:11197div.verseblock > pre.content {
198 font-family: inherit;
199 font-size: inherit;
Junio C Hamano81435632011-01-12 09:08:48200}
201div.verseblock > div.attribution {
202 padding-top: 0.75em;
203 text-align: left;
204}
205/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31206div.verseblock + div.attribution {
207 text-align: left;
208}
Junio C Hamano2fbcd212008-05-14 22:26:07209
210div.admonitionblock .icon {
211 vertical-align: top;
212 font-size: 1.1em;
213 font-weight: bold;
214 text-decoration: underline;
215 color: #527bbd;
216 padding-right: 0.5em;
217}
218div.admonitionblock td.content {
219 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22220 border-left: 3px solid #dddddd;
Junio C Hamano2fbcd212008-05-14 22:26:07221}
222
223div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22224 border-left: 3px solid #dddddd;
225 padding-left: 0.5em;
Junio C Hamano2fbcd212008-05-14 22:26:07226}
227
Junio C Hamano2fbcd212008-05-14 22:26:07228div.imageblock div.content { padding-left: 0; }
Junio C Hamanoc14e6ad2014-10-31 20:25:53229span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamano81435632011-01-12 09:08:48230a.image:visited { color: white; }
Junio C Hamano2fbcd212008-05-14 22:26:07231
232dl {
233 margin-top: 0.8em;
234 margin-bottom: 0.8em;
235}
236dt {
237 margin-top: 0.5em;
238 margin-bottom: 0;
Junio C Hamano81435632011-01-12 09:08:48239 font-style: normal;
240 color: navy;
Junio C Hamano2fbcd212008-05-14 22:26:07241}
242dd > *:first-child {
Junio C Hamano81435632011-01-12 09:08:48243 margin-top: 0.1em;
Junio C Hamano2fbcd212008-05-14 22:26:07244}
245
246ul, ol {
247 list-style-position: outside;
248}
Junio C Hamano81435632011-01-12 09:08:48249ol.arabic {
250 list-style-type: decimal;
251}
252ol.loweralpha {
Junio C Hamano2fbcd212008-05-14 22:26:07253 list-style-type: lower-alpha;
254}
Junio C Hamano81435632011-01-12 09:08:48255ol.upperalpha {
256 list-style-type: upper-alpha;
257}
258ol.lowerroman {
259 list-style-type: lower-roman;
260}
261ol.upperroman {
262 list-style-type: upper-roman;
263}
264
265div.compact ul, div.compact ol,
266div.compact p, div.compact p,
267div.compact div, div.compact div {
268 margin-top: 0.1em;
269 margin-bottom: 0.1em;
270}
Junio C Hamano2fbcd212008-05-14 22:26:07271
Junio C Hamano2fbcd212008-05-14 22:26:07272tfoot {
273 font-weight: bold;
274}
Junio C Hamano81435632011-01-12 09:08:48275td > div.verse {
276 white-space: pre;
277}
Junio C Hamano81435632011-01-12 09:08:48278
279div.hdlist {
Junio C Hamano2fbcd212008-05-14 22:26:07280 margin-top: 0.8em;
281 margin-bottom: 0.8em;
282}
Junio C Hamano81435632011-01-12 09:08:48283div.hdlist tr {
284 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31285}
Junio C Hamano81435632011-01-12 09:08:48286dt.hdlist1.strong, td.hdlist1.strong {
287 font-weight: bold;
288}
289td.hdlist1 {
Junio C Hamano2fbcd212008-05-14 22:26:07290 vertical-align: top;
Junio C Hamano81435632011-01-12 09:08:48291 font-style: normal;
Junio C Hamano2fbcd212008-05-14 22:26:07292 padding-right: 0.8em;
Junio C Hamano81435632011-01-12 09:08:48293 color: navy;
Junio C Hamano2fbcd212008-05-14 22:26:07294}
Junio C Hamano81435632011-01-12 09:08:48295td.hdlist2 {
Junio C Hamano2fbcd212008-05-14 22:26:07296 vertical-align: top;
297}
Junio C Hamano81435632011-01-12 09:08:48298div.hdlist.compact tr {
299 margin: 0;
300 padding-bottom: 0;
301}
302
303.comment {
304 background: yellow;
305}
Junio C Hamano2fbcd212008-05-14 22:26:07306
Junio C Hamano7bd050f2011-09-22 06:32:22307.footnote, .footnoteref {
308 font-size: 0.8em;
309}
310
311span.footnote, span.footnoteref {
312 vertical-align: super;
313}
314
315#footnotes {
316 margin: 20px 0 20px 0;
317 padding: 7px 0 0 0;
318}
319
320#footnotes div.footnote {
321 margin: 0 0 5px 0;
322}
323
324#footnotes hr {
325 border: none;
326 border-top: 1px solid silver;
327 height: 1px;
328 text-align: left;
329 margin-left: 0;
330 width: 20%;
331 min-width: 100px;
332}
333
Junio C Hamano9d971152012-12-19 00:43:11334div.colist td {
335 padding-right: 0.5em;
336 padding-bottom: 0.3em;
337 vertical-align: top;
338}
339div.colist td img {
340 margin-top: 0.3em;
Junio C Hamano2fbcd212008-05-14 22:26:07341}
Junio C Hamanoba4b9282008-07-06 05:20:31342
Junio C Hamano9d971152012-12-19 00:43:11343@media print {
344 #footer-badges { display: none; }
345}
346
347#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22348 margin-bottom: 2.5em;
349}
350
Junio C Hamano9d971152012-12-19 00:43:11351#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31352 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31353 font-size: 1.1em;
354 font-weight: bold;
355 margin-top: 1.0em;
356 margin-bottom: 0.1em;
357}
358
Junio C Hamanoc14e6ad2014-10-31 20:25:53359div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31360 margin-top: 0;
361 margin-bottom: 0;
362}
363div.toclevel2 {
364 margin-left: 2em;
365 font-size: 0.9em;
366}
367div.toclevel3 {
368 margin-left: 4em;
369 font-size: 0.9em;
370}
371div.toclevel4 {
372 margin-left: 6em;
373 font-size: 0.9em;
374}
Junio C Hamano9d971152012-12-19 00:43:11375
376span.aqua { color: aqua; }
377span.black { color: black; }
378span.blue { color: blue; }
379span.fuchsia { color: fuchsia; }
380span.gray { color: gray; }
381span.green { color: green; }
382span.lime { color: lime; }
383span.maroon { color: maroon; }
384span.navy { color: navy; }
385span.olive { color: olive; }
386span.purple { color: purple; }
387span.red { color: red; }
388span.silver { color: silver; }
389span.teal { color: teal; }
390span.white { color: white; }
391span.yellow { color: yellow; }
392
393span.aqua-background { background: aqua; }
394span.black-background { background: black; }
395span.blue-background { background: blue; }
396span.fuchsia-background { background: fuchsia; }
397span.gray-background { background: gray; }
398span.green-background { background: green; }
399span.lime-background { background: lime; }
400span.maroon-background { background: maroon; }
401span.navy-background { background: navy; }
402span.olive-background { background: olive; }
403span.purple-background { background: purple; }
404span.red-background { background: red; }
405span.silver-background { background: silver; }
406span.teal-background { background: teal; }
407span.white-background { background: white; }
408span.yellow-background { background: yellow; }
409
410span.big { font-size: 2em; }
411span.small { font-size: 0.6em; }
412
413span.underline { text-decoration: underline; }
414span.overline { text-decoration: overline; }
415span.line-through { text-decoration: line-through; }
416
Junio C Hamanoc14e6ad2014-10-31 20:25:53417div.unbreakable { page-break-inside: avoid; }
418
Junio C Hamano9d971152012-12-19 00:43:11419
420/*
421 * xhtml11 specific
422 *
423 * */
424
425div.tableblock {
426 margin-top: 1.0em;
427 margin-bottom: 1.5em;
428}
429div.tableblock > table {
430 border: 3px solid #527bbd;
431}
432thead, p.table.header {
433 font-weight: bold;
434 color: #527bbd;
435}
436p.table {
437 margin-top: 0;
438}
Junio C Hamano725b0da2020-01-22 22:02:40439/* Because the table frame attribute is overridden by CSS in most browsers. */
Junio C Hamano9d971152012-12-19 00:43:11440div.tableblock > table[frame="void"] {
441 border-style: none;
442}
443div.tableblock > table[frame="hsides"] {
444 border-left-style: none;
445 border-right-style: none;
446}
447div.tableblock > table[frame="vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
450}
451
452
453/*
454 * html5 specific
455 *
456 * */
457
458table.tableblock {
459 margin-top: 1.0em;
460 margin-bottom: 1.5em;
461}
462thead, p.tableblock.header {
463 font-weight: bold;
464 color: #527bbd;
465}
466p.tableblock {
467 margin-top: 0;
468}
469table.tableblock {
470 border-width: 3px;
471 border-spacing: 0px;
472 border-style: solid;
473 border-color: #527bbd;
474 border-collapse: collapse;
475}
476th.tableblock, td.tableblock {
477 border-width: 1px;
478 padding: 4px;
479 border-style: solid;
480 border-color: #527bbd;
481}
482
483table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
486}
487table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
490}
491table.tableblock.frame-none {
492 border-style: hidden;
493}
494
495th.tableblock.halign-left, td.tableblock.halign-left {
496 text-align: left;
497}
498th.tableblock.halign-center, td.tableblock.halign-center {
499 text-align: center;
500}
501th.tableblock.halign-right, td.tableblock.halign-right {
502 text-align: right;
503}
504
505th.tableblock.valign-top, td.tableblock.valign-top {
506 vertical-align: top;
507}
508th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
510}
511th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
513}
514
515
516/*
517 * manpage specific
518 *
519 * */
520
521body.manpage h1 {
Junio C Hamano81435632011-01-12 09:08:48522 padding-top: 0.5em;
523 padding-bottom: 0.5em;
524 border-top: 2px solid silver;
525 border-bottom: 2px solid silver;
526}
Junio C Hamano9d971152012-12-19 00:43:11527body.manpage h2 {
Junio C Hamano81435632011-01-12 09:08:48528 border-style: none;
529}
Junio C Hamano9d971152012-12-19 00:43:11530body.manpage div.sectionbody {
531 margin-left: 3em;
Junio C Hamano81435632011-01-12 09:08:48532}
533
534@media print {
Junio C Hamano9d971152012-12-19 00:43:11535 body.manpage div#toc { display: none; }
Junio C Hamano81435632011-01-12 09:08:48536}
Junio C Hamanoc14e6ad2014-10-31 20:25:53537
538
Junio C Hamano2fbcd212008-05-14 22:26:07539</style>
Junio C Hamano7bd050f2011-09-22 06:32:22540<script type="text/javascript">
541/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22542var asciidoc = { // Namespace.
543
544/////////////////////////////////////////////////////////////////////
545// Table Of Contents generator
546/////////////////////////////////////////////////////////////////////
547
548/* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
550 *
551 * Table Of Content generator
552 * Version: 0.4
553 *
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
556 */
557
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
560
561// toclevels = 1..4.
562toc: function (toclevels) {
563
564 function getText(el) {
565 var text = "";
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
568 text += i.data;
569 else if (i.firstChild != null)
570 text += getText(i);
571 }
572 return text;
573 }
574
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
579 }
580
581 function tocEntries(el, toclevels) {
582 var result = new Array;
Junio C Hamanoc14e6ad2014-10-31 20:25:53583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
586 // browsers).
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
593 }
594 iterate(i);
595 }
596 }
597 }
598 iterate(el);
599 return result;
600 }
601
602 var toc = document.getElementById("toc");
Junio C Hamano9d971152012-12-19 00:43:11603 if (!toc) {
604 return;
605 }
606
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
609 var i;
610 for (i = 0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53612 if (entry.nodeName.toLowerCase() == 'div'
Junio C Hamano9d971152012-12-19 00:43:11613 && entry.getAttribute("class")
614 && entry.getAttribute("class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
616 }
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
619 }
620
621 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22622 var entries = tocEntries(document.getElementById("content"), toclevels);
623 for (var i = 0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id == "")
626 entry.element.id = "_toc_" + i;
627 var a = document.createElement("a");
628 a.href = "#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement("div");
631 div.appendChild(a);
632 div.className = "toclevel" + entry.toclevel;
633 toc.appendChild(div);
634 }
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
637},
638
639
640/////////////////////////////////////////////////////////////////////
641// Footnotes generator
642/////////////////////////////////////////////////////////////////////
643
644/* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
646 */
647
648footnotes: function () {
Junio C Hamano9d971152012-12-19 00:43:11649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22651 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11652 if (!noteholder) {
653 return;
654 }
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9d971152012-12-19 00:43:11659 entriesToRemove.push(entry);
660 }
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
663 }
664
665 // Rebuild footnote entries.
666 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22667 var spans = cont.getElementsByTagName("span");
668 var refs = {};
669 var n = 0;
670 for (i=0; i<spans.length; i++) {
671 if (spans[i].className == "footnote") {
672 n++;
Junio C Hamano9d971152012-12-19 00:43:11673 var note = spans[i].getAttribute("data-note");
674 if (!note) {
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
678 spans[i].innerHTML =
679 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n + "</a>]";
681 spans[i].setAttribute("data-note", note);
682 }
Junio C Hamano7bd050f2011-09-22 06:32:22683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22687 var id =spans[i].getAttribute("id");
688 if (id != null) refs["#"+id] = n;
689 }
690 }
691 if (n == 0)
692 noteholder.parentNode.removeChild(noteholder);
693 else {
694 // Process footnoterefs.
695 for (i=0; i<spans.length; i++) {
696 if (spans[i].className == "footnoteref") {
697 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
698 href = href.match(/#.*/)[0]; // Because IE return full URL.
699 n = refs[href];
700 spans[i].innerHTML =
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n + "</a>]";
703 }
704 }
705 }
Junio C Hamano9d971152012-12-19 00:43:11706},
707
708install: function(toclevels) {
709 var timerId;
710
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
715 }
716 }
717
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
721 }
722
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22728}
729
730}
Junio C Hamano9d971152012-12-19 00:43:11731asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22732/*]]>*/
733</script>
Junio C Hamano2fbcd212008-05-14 22:26:07734</head>
Junio C Hamano9d971152012-12-19 00:43:11735<body class="manpage">
Junio C Hamano2fbcd212008-05-14 22:26:07736<div id="header">
737<h1>
738githooks(5) Manual Page
739</h1>
740<h2>NAME</h2>
741<div class="sectionbody">
742<p>githooks -
Junio C Hamano076ffcc2013-02-06 05:13:21743 Hooks used by Git
Junio C Hamano2fbcd212008-05-14 22:26:07744</p>
745</div>
746</div>
Junio C Hamano7bd050f2011-09-22 06:32:22747<div id="content">
Junio C Hamano9d971152012-12-19 00:43:11748<div class="sect1">
Junio C Hamano81435632011-01-12 09:08:48749<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano2fbcd212008-05-14 22:26:07750<div class="sectionbody">
Junio C Hamano198b1f12016-05-17 22:27:24751<div class="paragraph"><p>$GIT_DIR/hooks/* (or `git config core.hooksPath`/*)</p></div>
Junio C Hamano2fbcd212008-05-14 22:26:07752</div>
Junio C Hamano9d971152012-12-19 00:43:11753</div>
754<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31755<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano2fbcd212008-05-14 22:26:07756<div class="sectionbody">
Junio C Hamano198b1f12016-05-17 22:27:24757<div class="paragraph"><p>Hooks are programs you can place in a hooks directory to trigger
758actions at certain points in git&#8217;s execution. Hooks that don&#8217;t have
759the executable bit set are ignored.</p></div>
760<div class="paragraph"><p>By default the hooks directory is <code>$GIT_DIR/hooks</code>, but that can be
761changed via the <code>core.hooksPath</code> configuration variable (see
762<a href="git-config.html">git-config(1)</a>).</p></div>
763<div class="paragraph"><p>Before Git invokes a hook, it changes its working directory to either
Junio C Hamano4c60d9a2017-05-04 14:36:22764$GIT_DIR in a bare repository or the root of the working tree in a non-bare
765repository. An exception are hooks triggered during a push (<em>pre-receive</em>,
766<em>update</em>, <em>post-receive</em>, <em>post-update</em>, <em>push-to-checkout</em>) which are always
767executed in $GIT_DIR.</p></div>
Junio C Hamano198b1f12016-05-17 22:27:24768<div class="paragraph"><p>Hooks can get their arguments via the environment, command-line
769arguments, and stdin. See the documentation for each hook below for
770details.</p></div>
Junio C Hamanob9d9d902018-05-23 07:07:42771<div class="paragraph"><p><code>git init</code> may copy hooks to the new repository, depending on its
Junio C Hamano198b1f12016-05-17 22:27:24772configuration. See the "TEMPLATE DIRECTORY" section in
773<a href="git-init.html">git-init(1)</a> for details. When the rest of this document refers
774to "default hooks" it&#8217;s talking about the default template shipped
775with Git.</p></div>
776<div class="paragraph"><p>The currently supported hooks are described below.</p></div>
Junio C Hamano2fbcd212008-05-14 22:26:07777</div>
Junio C Hamano9d971152012-12-19 00:43:11778</div>
779<div class="sect1">
Junio C Hamanoc28068f2009-09-08 00:55:23780<h2 id="_hooks">HOOKS</h2>
Junio C Hamano2fbcd212008-05-14 22:26:07781<div class="sectionbody">
Junio C Hamano9d971152012-12-19 00:43:11782<div class="sect2">
783<h3 id="_applypatch_msg">applypatch-msg</h3>
Junio C Hamanob9d9d902018-05-23 07:07:42784<div class="paragraph"><p>This hook is invoked by <a href="git-am.html">git-am(1)</a>. It takes a single
Junio C Hamano2fbcd212008-05-14 22:26:07785parameter, the name of the file that holds the proposed commit
Junio C Hamanob9d9d902018-05-23 07:07:42786log message. Exiting with a non-zero status causes <code>git am</code> to abort
Junio C Hamano198b1f12016-05-17 22:27:24787before applying the patch.</p></div>
Junio C Hamano81435632011-01-12 09:08:48788<div class="paragraph"><p>The hook is allowed to edit the message file in place, and can
Junio C Hamano2fbcd212008-05-14 22:26:07789be used to normalize the message into some project standard
Junio C Hamano198b1f12016-05-17 22:27:24790format. It can also be used to refuse the commit after inspecting
791the message file.</p></div>
Junio C Hamano81435632011-01-12 09:08:48792<div class="paragraph"><p>The default <em>applypatch-msg</em> hook, when enabled, runs the
Junio C Hamanoba4b9282008-07-06 05:20:31793<em>commit-msg</em> hook, if the latter is enabled.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11794</div>
795<div class="sect2">
796<h3 id="_pre_applypatch">pre-applypatch</h3>
Junio C Hamanob9d9d902018-05-23 07:07:42797<div class="paragraph"><p>This hook is invoked by <a href="git-am.html">git-am(1)</a>. It takes no parameter, and is
Junio C Hamanoba4b9282008-07-06 05:20:31798invoked after the patch is applied, but before a commit is made.</p></div>
Junio C Hamano81435632011-01-12 09:08:48799<div class="paragraph"><p>If it exits with non-zero status, then the working tree will not be
Junio C Hamanoba4b9282008-07-06 05:20:31800committed after applying the patch.</p></div>
Junio C Hamano81435632011-01-12 09:08:48801<div class="paragraph"><p>It can be used to inspect the current working tree and refuse to
Junio C Hamanoba4b9282008-07-06 05:20:31802make a commit if it does not pass certain test.</p></div>
Junio C Hamano81435632011-01-12 09:08:48803<div class="paragraph"><p>The default <em>pre-applypatch</em> hook, when enabled, runs the
Junio C Hamanoba4b9282008-07-06 05:20:31804<em>pre-commit</em> hook, if the latter is enabled.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11805</div>
806<div class="sect2">
807<h3 id="_post_applypatch">post-applypatch</h3>
Junio C Hamanob9d9d902018-05-23 07:07:42808<div class="paragraph"><p>This hook is invoked by <a href="git-am.html">git-am(1)</a>. It takes no parameter,
Junio C Hamanoba4b9282008-07-06 05:20:31809and is invoked after the patch is applied and a commit is made.</p></div>
Junio C Hamano81435632011-01-12 09:08:48810<div class="paragraph"><p>This hook is meant primarily for notification, and cannot affect
Junio C Hamanob9d9d902018-05-23 07:07:42811the outcome of <code>git am</code>.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11812</div>
813<div class="sect2">
814<h3 id="_pre_commit">pre-commit</h3>
Junio C Hamanob9d9d902018-05-23 07:07:42815<div class="paragraph"><p>This hook is invoked by <a href="git-commit.html">git-commit(1)</a>, and can be bypassed
Junio C Hamano198b1f12016-05-17 22:27:24816with the <code>--no-verify</code> option. It takes no parameters, and is
Junio C Hamano2fbcd212008-05-14 22:26:07817invoked before obtaining the proposed commit log message and
Junio C Hamano198b1f12016-05-17 22:27:24818making a commit. Exiting with a non-zero status from this script
Junio C Hamanob9d9d902018-05-23 07:07:42819causes the <code>git commit</code> command to abort before creating a commit.</p></div>
Junio C Hamano81435632011-01-12 09:08:48820<div class="paragraph"><p>The default <em>pre-commit</em> hook, when enabled, catches introduction
Junio C Hamano2fbcd212008-05-14 22:26:07821of lines with trailing whitespaces and aborts the commit when
Junio C Hamanoba4b9282008-07-06 05:20:31822such a line is found.</p></div>
Junio C Hamanob9d9d902018-05-23 07:07:42823<div class="paragraph"><p>All the <code>git commit</code> hooks are invoked with the environment
Junio C Hamanoc14e6ad2014-10-31 20:25:53824variable <code>GIT_EDITOR=:</code> if the command will not bring up an editor
Junio C Hamanoba4b9282008-07-06 05:20:31825to modify the commit message.</p></div>
Junio C Hamano11f15372019-03-07 03:17:00826<div class="paragraph"><p>The default <em>pre-commit</em> hook, when enabled&#8212;and with the
827<code>hooks.allownonascii</code> config option unset or set to false&#8212;prevents
828the use of non-ASCII filenames.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11829</div>
830<div class="sect2">
Junio C Hamanocb705392019-09-18 19:30:01831<h3 id="_pre_merge_commit">pre-merge-commit</h3>
832<div class="paragraph"><p>This hook is invoked by <a href="git-merge.html">git-merge(1)</a>, and can be bypassed
833with the <code>--no-verify</code> option. It takes no parameters, and is
834invoked after the merge has been carried out successfully and before
835obtaining the proposed commit log message to
836make a commit. Exiting with a non-zero status from this script
837causes the <code>git merge</code> command to abort before creating a commit.</p></div>
838<div class="paragraph"><p>The default <em>pre-merge-commit</em> hook, when enabled, runs the
839<em>pre-commit</em> hook, if the latter is enabled.</p></div>
840<div class="paragraph"><p>This hook is invoked with the environment variable
841<code>GIT_EDITOR=:</code> if the command will not bring up an editor
842to modify the commit message.</p></div>
843<div class="paragraph"><p>If the merge cannot be carried out automatically, the conflicts
844need to be resolved and the result committed separately (see
845<a href="git-merge.html">git-merge(1)</a>). At that point, this hook will not be executed,
846but the <em>pre-commit</em> hook will, if it is enabled.</p></div>
847</div>
848<div class="sect2">
Junio C Hamano9d971152012-12-19 00:43:11849<h3 id="_prepare_commit_msg">prepare-commit-msg</h3>
Junio C Hamanob9d9d902018-05-23 07:07:42850<div class="paragraph"><p>This hook is invoked by <a href="git-commit.html">git-commit(1)</a> right after preparing the
Junio C Hamanoba4b9282008-07-06 05:20:31851default log message, and before the editor is started.</p></div>
Junio C Hamano81435632011-01-12 09:08:48852<div class="paragraph"><p>It takes one to three parameters. The first is the name of the file
Junio C Hamanobd53dbf2009-01-18 18:26:37853that contains the commit log message. The second is the source of the commit
Junio C Hamanoc14e6ad2014-10-31 20:25:53854message, and can be: <code>message</code> (if a <code>-m</code> or <code>-F</code> option was
855given); <code>template</code> (if a <code>-t</code> option was given or the
856configuration option <code>commit.template</code> is set); <code>merge</code> (if the
857commit is a merge or a <code>.git/MERGE_MSG</code> file exists); <code>squash</code>
858(if a <code>.git/SQUASH_MSG</code> file exists); or <code>commit</code>, followed by
859a commit SHA-1 (if a <code>-c</code>, <code>-C</code> or <code>--amend</code> option was given).</p></div>
Junio C Hamanob9d9d902018-05-23 07:07:42860<div class="paragraph"><p>If the exit status is non-zero, <code>git commit</code> will abort.</p></div>
Junio C Hamano81435632011-01-12 09:08:48861<div class="paragraph"><p>The purpose of the hook is to edit the message file in place, and
Junio C Hamanoc14e6ad2014-10-31 20:25:53862it is not suppressed by the <code>--no-verify</code> option. A non-zero exit
Junio C Hamano2fbcd212008-05-14 22:26:07863means a failure of the hook and aborts the commit. It should not
Junio C Hamanoba4b9282008-07-06 05:20:31864be used as replacement for pre-commit hook.</p></div>
Junio C Hamano4b2a6c12017-08-22 18:32:37865<div class="paragraph"><p>The sample <code>prepare-commit-msg</code> hook that comes with Git removes the
866help message found in the commented portion of the commit template.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11867</div>
868<div class="sect2">
869<h3 id="_commit_msg">commit-msg</h3>
Junio C Hamanob9d9d902018-05-23 07:07:42870<div class="paragraph"><p>This hook is invoked by <a href="git-commit.html">git-commit(1)</a> and <a href="git-merge.html">git-merge(1)</a>, and can be
Junio C Hamanoef75f372017-09-29 04:22:33871bypassed with the <code>--no-verify</code> option. It takes a single parameter,
872the name of the file that holds the proposed commit log message.
873Exiting with a non-zero status causes the command to abort.</p></div>
Junio C Hamano198b1f12016-05-17 22:27:24874<div class="paragraph"><p>The hook is allowed to edit the message file in place, and can be used
875to normalize the message into some project standard format. It
876can also be used to refuse the commit after inspecting the message
877file.</p></div>
Junio C Hamano81435632011-01-12 09:08:48878<div class="paragraph"><p>The default <em>commit-msg</em> hook, when enabled, detects duplicate
Junio C Hamanodf3d3cd2020-11-02 22:05:05879<code>Signed-off-by</code> trailers, and aborts the commit if one is found.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11880</div>
881<div class="sect2">
882<h3 id="_post_commit">post-commit</h3>
Junio C Hamanob9d9d902018-05-23 07:07:42883<div class="paragraph"><p>This hook is invoked by <a href="git-commit.html">git-commit(1)</a>. It takes no parameters, and is
Junio C Hamano198b1f12016-05-17 22:27:24884invoked after a commit is made.</p></div>
Junio C Hamano81435632011-01-12 09:08:48885<div class="paragraph"><p>This hook is meant primarily for notification, and cannot affect
Junio C Hamanob9d9d902018-05-23 07:07:42886the outcome of <code>git commit</code>.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11887</div>
888<div class="sect2">
889<h3 id="_pre_rebase">pre-rebase</h3>
Junio C Hamanob9d9d902018-05-23 07:07:42890<div class="paragraph"><p>This hook is called by <a href="git-rebase.html">git-rebase(1)</a> and can be used to prevent a
Junio C Hamano947ab822013-03-19 23:07:29891branch from getting rebased. The hook may be called with one or
892two parameters. The first parameter is the upstream from which
893the series was forked. The second parameter is the branch being
894rebased, and is not set when rebasing the current branch.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11895</div>
896<div class="sect2">
897<h3 id="_post_checkout">post-checkout</h3>
Junio C Hamanoc9f11c22019-07-10 02:54:04898<div class="paragraph"><p>This hook is invoked when a <a href="git-checkout.html">git-checkout(1)</a> or
899<a href="git-switch.html">git-switch(1)</a> is run after having updated the
Junio C Hamano2fbcd212008-05-14 22:26:07900worktree. The hook is given three parameters: the ref of the previous HEAD,
901the ref of the new HEAD (which may or may not have changed), and a flag
902indicating whether the checkout was a branch checkout (changing branches,
903flag=1) or a file checkout (retrieving a file from the index, flag=0).
Junio C Hamano558abd22020-09-03 20:22:34904This hook cannot affect the outcome of <code>git switch</code> or <code>git checkout</code>,
905other than that the hook&#8217;s exit status becomes the exit status of
906these two commands.</p></div>
Junio C Hamanob9d9d902018-05-23 07:07:42907<div class="paragraph"><p>It is also run after <a href="git-clone.html">git-clone(1)</a>, unless the <code>--no-checkout</code> (<code>-n</code>) option is
Junio C Hamano36a56722009-03-28 08:55:34908used. The first parameter given to the hook is the null-ref, the second the
Junio C Hamanob9d9d902018-05-23 07:07:42909ref of the new HEAD and the flag is always 1. Likewise for <code>git worktree add</code>
910unless <code>--no-checkout</code> is used.</p></div>
Junio C Hamano81435632011-01-12 09:08:48911<div class="paragraph"><p>This hook can be used to perform repository validity checks, auto-display
Junio C Hamano2fbcd212008-05-14 22:26:07912differences from the previous HEAD if different, or set working dir metadata
Junio C Hamanoba4b9282008-07-06 05:20:31913properties.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11914</div>
915<div class="sect2">
916<h3 id="_post_merge">post-merge</h3>
Junio C Hamanob9d9d902018-05-23 07:07:42917<div class="paragraph"><p>This hook is invoked by <a href="git-merge.html">git-merge(1)</a>, which happens when a <code>git pull</code>
Junio C Hamano2fbcd212008-05-14 22:26:07918is done on a local repository. The hook takes a single parameter, a status
919flag specifying whether or not the merge being done was a squash merge.
Junio C Hamanob9d9d902018-05-23 07:07:42920This hook cannot affect the outcome of <code>git merge</code> and is not executed,
Junio C Hamanoba4b9282008-07-06 05:20:31921if the merge failed due to conflicts.</p></div>
Junio C Hamano81435632011-01-12 09:08:48922<div class="paragraph"><p>This hook can be used in conjunction with a corresponding pre-commit hook to
Junio C Hamano2fbcd212008-05-14 22:26:07923save and restore any form of metadata associated with the working tree
Junio C Hamanofb5ffde2014-11-04 22:38:56924(e.g.: permissions/ownership, ACLS, etc). See contrib/hooks/setgitperms.perl
Junio C Hamanoba4b9282008-07-06 05:20:31925for an example of how to do this.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11926</div>
927<div class="sect2">
Junio C Hamano36d52292013-01-25 21:32:36928<h3 id="_pre_push">pre-push</h3>
Junio C Hamanob9d9d902018-05-23 07:07:42929<div class="paragraph"><p>This hook is called by <a href="git-push.html">git-push(1)</a> and can be used to prevent
930a push from taking place. The hook is called with two parameters
931which provide the name and location of the destination remote, if a
932named remote is not being used both values will be the same.</p></div>
Junio C Hamano36d52292013-01-25 21:32:36933<div class="paragraph"><p>Information about what is to be pushed is provided on the hook&#8217;s standard
934input with lines of the form:</p></div>
935<div class="literalblock">
936<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53937<pre><code>&lt;local ref&gt; SP &lt;local sha1&gt; SP &lt;remote ref&gt; SP &lt;remote sha1&gt; LF</code></pre>
Junio C Hamano36d52292013-01-25 21:32:36938</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:53939<div class="paragraph"><p>For instance, if the command <code>git push origin master:foreign</code> were run the
Junio C Hamano36d52292013-01-25 21:32:36940hook would receive a line like the following:</p></div>
941<div class="literalblock">
942<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53943<pre><code>refs/heads/master 67890 refs/heads/foreign 12345</code></pre>
Junio C Hamano36d52292013-01-25 21:32:36944</div></div>
Junio C Hamanoe3f080d2013-04-22 02:27:13945<div class="paragraph"><p>although the full, 40-character SHA-1s would be supplied. If the foreign ref
Junio C Hamanoc14e6ad2014-10-31 20:25:53946does not yet exist the <code>&lt;remote SHA-1&gt;</code> will be 40 <code>0</code>. If a ref is to be
947deleted, the <code>&lt;local ref&gt;</code> will be supplied as <code>(delete)</code> and the <code>&lt;local
948SHA-1&gt;</code> will be 40 <code>0</code>. If the local commit was specified by something other
949than a name which could be expanded (such as <code>HEAD~</code>, or a SHA-1) it will be
Junio C Hamano36d52292013-01-25 21:32:36950supplied as it was originally given.</p></div>
Junio C Hamanob9d9d902018-05-23 07:07:42951<div class="paragraph"><p>If this hook exits with a non-zero status, <code>git push</code> will abort without
Junio C Hamano36d52292013-01-25 21:32:36952pushing anything. Information about why the push is rejected may be sent
953to the user by writing to standard error.</p></div>
954</div>
955<div class="sect2">
Junio C Hamano9d971152012-12-19 00:43:11956<h3 id="pre-receive">pre-receive</h3>
Junio C Hamanob9d9d902018-05-23 07:07:42957<div class="paragraph"><p>This hook is invoked by <a href="git-receive-pack.html">git-receive-pack(1)</a> when it reacts to
958<code>git push</code> and updates reference(s) in its repository.
Junio C Hamano2fbcd212008-05-14 22:26:07959Just before starting to update refs on the remote repository, the
960pre-receive hook is invoked. Its exit status determines the success
Junio C Hamanoba4b9282008-07-06 05:20:31961or failure of the update.</p></div>
Junio C Hamano81435632011-01-12 09:08:48962<div class="paragraph"><p>This hook executes once for the receive operation. It takes no
Junio C Hamano2fbcd212008-05-14 22:26:07963arguments, but for each ref to be updated it receives on standard
Junio C Hamanoba4b9282008-07-06 05:20:31964input a line of the format:</p></div>
Junio C Hamano2fbcd212008-05-14 22:26:07965<div class="literalblock">
966<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53967<pre><code>&lt;old-value&gt; SP &lt;new-value&gt; SP &lt;ref-name&gt; LF</code></pre>
Junio C Hamano2fbcd212008-05-14 22:26:07968</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:53969<div class="paragraph"><p>where <code>&lt;old-value&gt;</code> is the old object name stored in the ref,
970<code>&lt;new-value&gt;</code> is the new object name to be stored in the ref and
971<code>&lt;ref-name&gt;</code> is the full name of the ref.
972When creating a new ref, <code>&lt;old-value&gt;</code> is 40 <code>0</code>.</p></div>
Junio C Hamano81435632011-01-12 09:08:48973<div class="paragraph"><p>If the hook exits with non-zero status, none of the refs will be
Junio C Hamano2fbcd212008-05-14 22:26:07974updated. If the hook exits with zero, updating of individual refs can
Junio C Hamanoba4b9282008-07-06 05:20:31975still be prevented by the <a href="#update"><em>update</em></a> hook.</p></div>
Junio C Hamano81435632011-01-12 09:08:48976<div class="paragraph"><p>Both standard output and standard error output are forwarded to
Junio C Hamanob9d9d902018-05-23 07:07:42977<code>git send-pack</code> on the other end, so you can simply <code>echo</code> messages
Junio C Hamanoba4b9282008-07-06 05:20:31978for the user.</p></div>
Junio C Hamanoe48a1132016-08-03 22:40:21979<div class="paragraph"><p>The number of push options given on the command line of
980<code>git push --push-option=...</code> can be read from the environment
981variable <code>GIT_PUSH_OPTION_COUNT</code>, and the options themselves are
982found in <code>GIT_PUSH_OPTION_0</code>, <code>GIT_PUSH_OPTION_1</code>,&#8230;
983If it is negotiated to not use the push options phase, the
984environment variables will not be set. If the client selects
985to use push options, but doesn&#8217;t transmit any, the count variable
986will be set to zero, <code>GIT_PUSH_OPTION_COUNT=0</code>.</p></div>
Junio C Hamanoe25cc812017-04-24 06:17:43987<div class="paragraph"><p>See the section on "Quarantine Environment" in
988<a href="git-receive-pack.html">git-receive-pack(1)</a> for some caveats.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11989</div>
990<div class="sect2">
991<h3 id="update">update</h3>
Junio C Hamanob9d9d902018-05-23 07:07:42992<div class="paragraph"><p>This hook is invoked by <a href="git-receive-pack.html">git-receive-pack(1)</a> when it reacts to
993<code>git push</code> and updates reference(s) in its repository.
Junio C Hamano2fbcd212008-05-14 22:26:07994Just before updating the ref on the remote repository, the update hook
995is invoked. Its exit status determines the success or failure of
Junio C Hamanoba4b9282008-07-06 05:20:31996the ref update.</p></div>
Junio C Hamano81435632011-01-12 09:08:48997<div class="paragraph"><p>The hook executes once for each ref to be updated, and takes
Junio C Hamanoba4b9282008-07-06 05:20:31998three parameters:</p></div>
Junio C Hamano81435632011-01-12 09:08:48999<div class="ulist"><ul>
Junio C Hamano2fbcd212008-05-14 22:26:071000<li>
1001<p>
1002the name of the ref being updated,
1003</p>
1004</li>
1005<li>
1006<p>
1007the old object name stored in the ref,
1008</p>
1009</li>
1010<li>
1011<p>
Junio C Hamano826f5c42014-02-07 20:33:301012and the new object name to be stored in the ref.
Junio C Hamano2fbcd212008-05-14 22:26:071013</p>
1014</li>
Junio C Hamanoba4b9282008-07-06 05:20:311015</ul></div>
Junio C Hamano81435632011-01-12 09:08:481016<div class="paragraph"><p>A zero exit from the update hook allows the ref to be updated.
Junio C Hamanob9d9d902018-05-23 07:07:421017Exiting with a non-zero status prevents <code>git receive-pack</code>
Junio C Hamanoba4b9282008-07-06 05:20:311018from updating that ref.</p></div>
Junio C Hamano81435632011-01-12 09:08:481019<div class="paragraph"><p>This hook can be used to prevent <em>forced</em> update on certain refs by
Junio C Hamano2fbcd212008-05-14 22:26:071020making sure that the object name is a commit object that is a
1021descendant of the commit object named by the old object name.
Junio C Hamano3f680f32009-11-16 02:10:541022That is, to enforce a "fast-forward only" policy.</p></div>
Junio C Hamano81435632011-01-12 09:08:481023<div class="paragraph"><p>It could also be used to log the old..new status. However, it
Junio C Hamano2fbcd212008-05-14 22:26:071024does not know the entire set of branches, so it would end up
1025firing one e-mail per ref when used naively, though. The
Junio C Hamanoba4b9282008-07-06 05:20:311026<a href="#post-receive"><em>post-receive</em></a> hook is more suited to that.</p></div>
Junio C Hamano198b1f12016-05-17 22:27:241027<div class="paragraph"><p>In an environment that restricts the users' access only to git
1028commands over the wire, this hook can be used to implement access
1029control without relying on filesystem ownership and group
1030membership. See <a href="git-shell.html">git-shell(1)</a> for how you might use the login
1031shell to restrict the user&#8217;s access to only git commands.</p></div>
Junio C Hamano81435632011-01-12 09:08:481032<div class="paragraph"><p>Both standard output and standard error output are forwarded to
Junio C Hamanob9d9d902018-05-23 07:07:421033<code>git send-pack</code> on the other end, so you can simply <code>echo</code> messages
Junio C Hamanoba4b9282008-07-06 05:20:311034for the user.</p></div>
Junio C Hamano81435632011-01-12 09:08:481035<div class="paragraph"><p>The default <em>update</em> hook, when enabled&#8212;and with
Junio C Hamanoc14e6ad2014-10-31 20:25:531036<code>hooks.allowunannotated</code> config option unset or set to false&#8212;prevents
Junio C Hamanoba4b9282008-07-06 05:20:311037unannotated tags to be pushed.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111038</div>
1039<div class="sect2">
Junio C Hamanoc562f6d2020-09-25 22:50:121040<h3 id="proc-receive">proc-receive</h3>
1041<div class="paragraph"><p>This hook is invoked by <a href="git-receive-pack.html">git-receive-pack(1)</a>. If the server has
1042set the multi-valued config variable <code>receive.procReceiveRefs</code>, and the
1043commands sent to <em>receive-pack</em> have matching reference names, these
1044commands will be executed by this hook, instead of by the internal
1045<code>execute_commands()</code> function. This hook is responsible for updating
1046the relevant references and reporting the results back to <em>receive-pack</em>.</p></div>
1047<div class="paragraph"><p>This hook executes once for the receive operation. It takes no
1048arguments, but uses a pkt-line format protocol to communicate with
1049<em>receive-pack</em> to read commands, push-options and send results. In the
1050following example for the protocol, the letter <em>S</em> stands for
1051<em>receive-pack</em> and the letter <em>H</em> stands for this hook.</p></div>
1052<div class="literalblock">
1053<div class="content">
1054<pre><code># Version and features negotiation.
1055S: PKT-LINE(version=1\0push-options atomic...)
1056S: flush-pkt
1057H: PKT-LINE(version=1\0push-options...)
1058H: flush-pkt</code></pre>
1059</div></div>
1060<div class="literalblock">
1061<div class="content">
1062<pre><code># Send commands from server to the hook.
1063S: PKT-LINE(&lt;old-oid&gt; &lt;new-oid&gt; &lt;ref&gt;)
1064S: ... ...
1065S: flush-pkt
1066# Send push-options only if the 'push-options' feature is enabled.
1067S: PKT-LINE(push-option)
1068S: ... ...
1069S: flush-pkt</code></pre>
1070</div></div>
1071<div class="literalblock">
1072<div class="content">
1073<pre><code># Receive result from the hook.
1074# OK, run this command successfully.
1075H: PKT-LINE(ok &lt;ref&gt;)
1076# NO, I reject it.
1077H: PKT-LINE(ng &lt;ref&gt; &lt;reason&gt;)
1078# Fall through, let 'receive-pack' to execute it.
1079H: PKT-LINE(ok &lt;ref&gt;)
1080H: PKT-LINE(option fall-through)
1081# OK, but has an alternate reference. The alternate reference name
1082# and other status can be given in option directives.
1083H: PKT-LINE(ok &lt;ref&gt;)
1084H: PKT-LINE(option refname &lt;refname&gt;)
1085H: PKT-LINE(option old-oid &lt;old-oid&gt;)
1086H: PKT-LINE(option new-oid &lt;new-oid&gt;)
1087H: PKT-LINE(option forced-update)
1088H: ... ...
1089H: flush-pkt</code></pre>
1090</div></div>
1091<div class="paragraph"><p>Each command for the <em>proc-receive</em> hook may point to a pseudo-reference
1092and always has a zero-old as its old-oid, while the <em>proc-receive</em> hook
1093may update an alternate reference and the alternate reference may exist
1094already with a non-zero old-oid. For this case, this hook will use
1095"option" directives to report extended attributes for the reference given
1096by the leading "ok" directive.</p></div>
1097<div class="paragraph"><p>The report of the commands of this hook should have the same order as
1098the input. The exit status of the <em>proc-receive</em> hook only determines
1099the success or failure of the group of commands sent to it, unless
1100atomic push is in use.</p></div>
1101</div>
1102<div class="sect2">
Junio C Hamano9d971152012-12-19 00:43:111103<h3 id="post-receive">post-receive</h3>
Junio C Hamanob9d9d902018-05-23 07:07:421104<div class="paragraph"><p>This hook is invoked by <a href="git-receive-pack.html">git-receive-pack(1)</a> when it reacts to
1105<code>git push</code> and updates reference(s) in its repository.
Junio C Hamano2fbcd212008-05-14 22:26:071106It executes on the remote repository once after all the refs have
Junio C Hamanoba4b9282008-07-06 05:20:311107been updated.</p></div>
Junio C Hamano81435632011-01-12 09:08:481108<div class="paragraph"><p>This hook executes once for the receive operation. It takes no
Junio C Hamano2fbcd212008-05-14 22:26:071109arguments, but gets the same information as the
1110<a href="#pre-receive"><em>pre-receive</em></a>
Junio C Hamanoba4b9282008-07-06 05:20:311111hook does on its standard input.</p></div>
Junio C Hamanob9d9d902018-05-23 07:07:421112<div class="paragraph"><p>This hook does not affect the outcome of <code>git receive-pack</code>, as it
Junio C Hamanoba4b9282008-07-06 05:20:311113is called after the real work is done.</p></div>
Junio C Hamano81435632011-01-12 09:08:481114<div class="paragraph"><p>This supersedes the <a href="#post-update"><em>post-update</em></a> hook in that it gets
Junio C Hamano2fbcd212008-05-14 22:26:071115both old and new values of all the refs in addition to their
Junio C Hamanoba4b9282008-07-06 05:20:311116names.</p></div>
Junio C Hamano81435632011-01-12 09:08:481117<div class="paragraph"><p>Both standard output and standard error output are forwarded to
Junio C Hamanob9d9d902018-05-23 07:07:421118<code>git send-pack</code> on the other end, so you can simply <code>echo</code> messages
Junio C Hamanoba4b9282008-07-06 05:20:311119for the user.</p></div>
Junio C Hamano81435632011-01-12 09:08:481120<div class="paragraph"><p>The default <em>post-receive</em> hook is empty, but there is
Junio C Hamanoc14e6ad2014-10-31 20:25:531121a sample script <code>post-receive-email</code> provided in the <code>contrib/hooks</code>
Junio C Hamano076ffcc2013-02-06 05:13:211122directory in Git distribution, which implements sending commit
Junio C Hamanoba4b9282008-07-06 05:20:311123emails.</p></div>
Junio C Hamanoe48a1132016-08-03 22:40:211124<div class="paragraph"><p>The number of push options given on the command line of
1125<code>git push --push-option=...</code> can be read from the environment
1126variable <code>GIT_PUSH_OPTION_COUNT</code>, and the options themselves are
1127found in <code>GIT_PUSH_OPTION_0</code>, <code>GIT_PUSH_OPTION_1</code>,&#8230;
1128If it is negotiated to not use the push options phase, the
1129environment variables will not be set. If the client selects
1130to use push options, but doesn&#8217;t transmit any, the count variable
1131will be set to zero, <code>GIT_PUSH_OPTION_COUNT=0</code>.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111132</div>
1133<div class="sect2">
1134<h3 id="post-update">post-update</h3>
Junio C Hamanob9d9d902018-05-23 07:07:421135<div class="paragraph"><p>This hook is invoked by <a href="git-receive-pack.html">git-receive-pack(1)</a> when it reacts to
1136<code>git push</code> and updates reference(s) in its repository.
Junio C Hamano2fbcd212008-05-14 22:26:071137It executes on the remote repository once after all the refs have
Junio C Hamanoba4b9282008-07-06 05:20:311138been updated.</p></div>
Junio C Hamano81435632011-01-12 09:08:481139<div class="paragraph"><p>It takes a variable number of parameters, each of which is the
Junio C Hamanoba4b9282008-07-06 05:20:311140name of ref that was actually updated.</p></div>
Junio C Hamano81435632011-01-12 09:08:481141<div class="paragraph"><p>This hook is meant primarily for notification, and cannot affect
Junio C Hamanob9d9d902018-05-23 07:07:421142the outcome of <code>git receive-pack</code>.</p></div>
Junio C Hamano81435632011-01-12 09:08:481143<div class="paragraph"><p>The <em>post-update</em> hook can tell what are the heads that were pushed,
Junio C Hamano2fbcd212008-05-14 22:26:071144but it does not know what their original and updated values are,
1145so it is a poor place to do log old..new. The
1146<a href="#post-receive"><em>post-receive</em></a> hook does get both original and
1147updated values of the refs. You might consider it instead if you need
Junio C Hamanoba4b9282008-07-06 05:20:311148them.</p></div>
Junio C Hamano81435632011-01-12 09:08:481149<div class="paragraph"><p>When enabled, the default <em>post-update</em> hook runs
Junio C Hamanob9d9d902018-05-23 07:07:421150<code>git update-server-info</code> to keep the information used by dumb
Junio C Hamano88bf5712017-09-10 08:39:231151transports (e.g., HTTP) up to date. If you are publishing
Junio C Hamano076ffcc2013-02-06 05:13:211152a Git repository that is accessible via HTTP, you should
Junio C Hamanoba4b9282008-07-06 05:20:311153probably enable this hook.</p></div>
Junio C Hamano81435632011-01-12 09:08:481154<div class="paragraph"><p>Both standard output and standard error output are forwarded to
Junio C Hamanob9d9d902018-05-23 07:07:421155<code>git send-pack</code> on the other end, so you can simply <code>echo</code> messages
Junio C Hamanoba4b9282008-07-06 05:20:311156for the user.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111157</div>
1158<div class="sect2">
Junio C Hamanoc93f3212020-07-24 23:16:191159<h3 id="_reference_transaction">reference-transaction</h3>
Junio C Hamanoa8911782020-07-07 05:35:571160<div class="paragraph"><p>This hook is invoked by any Git command that performs reference
1161updates. It executes whenever a reference transaction is prepared,
1162committed or aborted and may thus get called multiple times.</p></div>
1163<div class="paragraph"><p>The hook takes exactly one argument, which is the current state the
1164given reference transaction is in:</p></div>
1165<div class="ulist"><ul>
1166<li>
1167<p>
1168"prepared": All reference updates have been queued to the
1169 transaction and references were locked on disk.
1170</p>
1171</li>
1172<li>
1173<p>
1174"committed": The reference transaction was committed and all
1175 references now have their respective new value.
1176</p>
1177</li>
1178<li>
1179<p>
1180"aborted": The reference transaction was aborted, no changes
1181 were performed and the locks have been released.
1182</p>
1183</li>
1184</ul></div>
1185<div class="paragraph"><p>For each reference update that was added to the transaction, the hook
1186receives on standard input a line of the format:</p></div>
1187<div class="literalblock">
1188<div class="content">
1189<pre><code>&lt;old-value&gt; SP &lt;new-value&gt; SP &lt;ref-name&gt; LF</code></pre>
1190</div></div>
1191<div class="paragraph"><p>The exit status of the hook is ignored for any state except for the
1192"prepared" state. In the "prepared" state, a non-zero exit status will
1193cause the transaction to be aborted. The hook will not be called with
1194"aborted" state in that case.</p></div>
1195</div>
1196<div class="sect2">
Junio C Hamano6bb32e62015-02-17 22:11:261197<h3 id="_push_to_checkout">push-to-checkout</h3>
Junio C Hamanob9d9d902018-05-23 07:07:421198<div class="paragraph"><p>This hook is invoked by <a href="git-receive-pack.html">git-receive-pack(1)</a> when it reacts to
1199<code>git push</code> and updates reference(s) in its repository, and when
Junio C Hamano6bb32e62015-02-17 22:11:261200the push tries to update the branch that is currently checked out
1201and the <code>receive.denyCurrentBranch</code> configuration variable is set to
1202<code>updateInstead</code>. Such a push by default is refused if the working
1203tree and the index of the remote repository has any difference from
1204the currently checked out commit; when both the working tree and the
1205index match the current commit, they are updated to match the newly
1206pushed tip of the branch. This hook is to be used to override the
1207default behaviour.</p></div>
1208<div class="paragraph"><p>The hook receives the commit with which the tip of the current
1209branch is going to be updated. It can exit with a non-zero status
1210to refuse the push (when it does so, it must not modify the index or
1211the working tree). Or it can make any necessary changes to the
1212working tree and to the index to bring them to the desired state
1213when the tip of the current branch is updated to the new commit, and
1214exit with a zero status.</p></div>
1215<div class="paragraph"><p>For example, the hook can simply run <code>git read-tree -u -m HEAD "$1"</code>
Junio C Hamanob9d9d902018-05-23 07:07:421216in order to emulate <code>git fetch</code> that is run in the reverse direction
1217with <code>git push</code>, as the two-tree form of <code>git read-tree -u -m</code> is
Junio C Hamanoc9f11c22019-07-10 02:54:041218essentially the same as <code>git switch</code> or <code>git checkout</code>
1219that switches branches while
Junio C Hamano6bb32e62015-02-17 22:11:261220keeping the local changes in the working tree that do not interfere
1221with the difference between the branches.</p></div>
1222</div>
1223<div class="sect2">
Junio C Hamano9d971152012-12-19 00:43:111224<h3 id="_pre_auto_gc">pre-auto-gc</h3>
Junio C Hamanob9d9d902018-05-23 07:07:421225<div class="paragraph"><p>This hook is invoked by <code>git gc --auto</code> (see <a href="git-gc.html">git-gc(1)</a>). It
1226takes no parameter, and exiting with non-zero status from this script
1227causes the <code>git gc --auto</code> to abort.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111228</div>
1229<div class="sect2">
1230<h3 id="_post_rewrite">post-rewrite</h3>
Junio C Hamanob9d9d902018-05-23 07:07:421231<div class="paragraph"><p>This hook is invoked by commands that rewrite commits
1232(<a href="git-commit.html">git-commit(1)</a> when called with <code>--amend</code> and
Junio C Hamanoa8858312019-09-30 05:07:451233<a href="git-rebase.html">git-rebase(1)</a>; however, full-history (re)writing tools like
1234<a href="git-fast-import.html">git-fast-import(1)</a> or
1235<a href="https://github.com/newren/git-filter-repo">git-filter-repo</a> typically
1236do not call it!). Its first argument denotes the command it was
1237invoked by: currently one of <code>amend</code> or <code>rebase</code>. Further
1238command-dependent arguments may be passed in the future.</p></div>
Junio C Hamano81435632011-01-12 09:08:481239<div class="paragraph"><p>The hook receives a list of the rewritten commits on stdin, in the
Junio C Hamano31667362010-03-25 00:38:531240format</p></div>
1241<div class="literalblock">
1242<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531243<pre><code>&lt;old-sha1&gt; SP &lt;new-sha1&gt; [ SP &lt;extra-info&gt; ] LF</code></pre>
Junio C Hamano31667362010-03-25 00:38:531244</div></div>
Junio C Hamano81435632011-01-12 09:08:481245<div class="paragraph"><p>The <em>extra-info</em> is again command-dependent. If it is empty, the
Junio C Hamano31667362010-03-25 00:38:531246preceding SP is also omitted. Currently, no commands pass any
1247<em>extra-info</em>.</p></div>
Junio C Hamano81435632011-01-12 09:08:481248<div class="paragraph"><p>The hook always runs after the automatic note copying (see
Junio C Hamano96fdfa12016-03-21 20:52:391249"notes.rewrite.&lt;command&gt;" in <a href="git-config.html">git-config(1)</a>) has happened, and
Junio C Hamano31667362010-03-25 00:38:531250thus has access to these notes.</p></div>
Junio C Hamano81435632011-01-12 09:08:481251<div class="paragraph"><p>The following command-specific comments apply:</p></div>
1252<div class="dlist"><dl>
1253<dt class="hdlist1">
Junio C Hamano31667362010-03-25 00:38:531254rebase
1255</dt>
1256<dd>
1257<p>
1258 For the <em>squash</em> and <em>fixup</em> operation, all commits that were
1259 squashed are listed as being rewritten to the squashed commit.
1260 This means that there will be several lines sharing the same
1261 <em>new-sha1</em>.
1262</p>
Junio C Hamano81435632011-01-12 09:08:481263<div class="paragraph"><p>The commits are guaranteed to be listed in the order that they were
Junio C Hamano31667362010-03-25 00:38:531264processed by rebase.</p></div>
1265</dd>
1266</dl></div>
Junio C Hamano2fbcd212008-05-14 22:26:071267</div>
Junio C Hamanod88ba732017-05-30 04:14:201268<div class="sect2">
1269<h3 id="_sendemail_validate">sendemail-validate</h3>
Junio C Hamanob9d9d902018-05-23 07:07:421270<div class="paragraph"><p>This hook is invoked by <a href="git-send-email.html">git-send-email(1)</a>. It takes a single parameter,
Junio C Hamanod88ba732017-05-30 04:14:201271the name of the file that holds the e-mail to be sent. Exiting with a
Junio C Hamanob9d9d902018-05-23 07:07:421272non-zero status causes <code>git send-email</code> to abort before sending any
Junio C Hamanod88ba732017-05-30 04:14:201273e-mails.</p></div>
1274</div>
Junio C Hamanod7105602017-11-21 05:32:501275<div class="sect2">
1276<h3 id="_fsmonitor_watchman">fsmonitor-watchman</h3>
Junio C Hamanob9d9d902018-05-23 07:07:421277<div class="paragraph"><p>This hook is invoked when the configuration option <code>core.fsmonitor</code> is
Junio C Hamanofc6646b2020-02-14 23:35:161278set to <code>.git/hooks/fsmonitor-watchman</code> or <code>.git/hooks/fsmonitor-watchmanv2</code>
1279depending on the version of the hook to use.</p></div>
1280<div class="paragraph"><p>Version 1 takes two arguments, a version (1) and the time in elapsed
1281nanoseconds since midnight, January 1, 1970.</p></div>
1282<div class="paragraph"><p>Version 2 takes two arguments, a version (2) and a token that is used
1283for identifying changes since the token. For watchman this would be
1284a clock id. This version must output to stdout the new token followed
1285by a NUL before the list of files.</p></div>
Junio C Hamanod7105602017-11-21 05:32:501286<div class="paragraph"><p>The hook should output to stdout the list of all files in the working
1287directory that may have changed since the requested time. The logic
1288should be inclusive so that it does not miss any potential changes.
1289The paths should be relative to the root of the working directory
1290and be separated by a single NUL.</p></div>
1291<div class="paragraph"><p>It is OK to include files which have not actually changed. All changes
1292including newly-created and deleted files should be included. When
1293files are renamed, both the old and the new name should be included.</p></div>
1294<div class="paragraph"><p>Git will limit what files it checks for changes as well as which
1295directories are checked for untracked files based on the path names
1296given.</p></div>
1297<div class="paragraph"><p>An optimized way to tell git "all files have changed" is to return
Junio C Hamanob9d9d902018-05-23 07:07:421298the filename <code>/</code>.</p></div>
Junio C Hamanod7105602017-11-21 05:32:501299<div class="paragraph"><p>The exit status determines whether git will use the data from the
1300hook to limit its search. On error, it will fall back to verifying
1301all files and folders.</p></div>
1302</div>
Junio C Hamanobfd91f42018-08-17 22:21:161303<div class="sect2">
Junio C Hamano67bf2242020-04-22 21:41:441304<h3 id="_p4_changelist">p4-changelist</h3>
1305<div class="paragraph"><p>This hook is invoked by <code>git-p4 submit</code>.</p></div>
1306<div class="paragraph"><p>The <code>p4-changelist</code> hook is executed after the changelist
1307message has been edited by the user. It can be bypassed with the
1308<code>--no-verify</code> option. It takes a single parameter, the name
1309of the file that holds the proposed changelist text. Exiting
1310with a non-zero status causes the command to abort.</p></div>
1311<div class="paragraph"><p>The hook is allowed to edit the changelist file and can be used
1312to normalize the text into some project standard format. It can
1313also be used to refuse the Submit after inspect the message file.</p></div>
1314<div class="paragraph"><p>Run <code>git-p4 submit --help</code> for details.</p></div>
1315</div>
1316<div class="sect2">
1317<h3 id="_p4_prepare_changelist">p4-prepare-changelist</h3>
1318<div class="paragraph"><p>This hook is invoked by <code>git-p4 submit</code>.</p></div>
1319<div class="paragraph"><p>The <code>p4-prepare-changelist</code> hook is executed right after preparing
1320the default changelist message and before the editor is started.
1321It takes one parameter, the name of the file that contains the
1322changelist text. Exiting with a non-zero status from the script
1323will abort the process.</p></div>
1324<div class="paragraph"><p>The purpose of the hook is to edit the message file in place,
1325and it is not supressed by the <code>--no-verify</code> option. This hook
1326is called even if <code>--prepare-p4-only</code> is set.</p></div>
1327<div class="paragraph"><p>Run <code>git-p4 submit --help</code> for details.</p></div>
1328</div>
1329<div class="sect2">
1330<h3 id="_p4_post_changelist">p4-post-changelist</h3>
1331<div class="paragraph"><p>This hook is invoked by <code>git-p4 submit</code>.</p></div>
1332<div class="paragraph"><p>The <code>p4-post-changelist</code> hook is invoked after the submit has
1333successfully occured in P4. It takes no parameters and is meant
1334primarily for notification and cannot affect the outcome of the
1335git p4 submit action.</p></div>
1336<div class="paragraph"><p>Run <code>git-p4 submit --help</code> for details.</p></div>
1337</div>
1338<div class="sect2">
Junio C Hamanobfd91f42018-08-17 22:21:161339<h3 id="_p4_pre_submit">p4-pre-submit</h3>
1340<div class="paragraph"><p>This hook is invoked by <code>git-p4 submit</code>. It takes no parameters and nothing
1341from standard input. Exiting with non-zero status from this script prevent
Junio C Hamano67bf2242020-04-22 21:41:441342<code>git-p4 submit</code> from launching. It can be bypassed with the <code>--no-verify</code>
1343command line option. Run <code>git-p4 submit --help</code> for details.</p></div>
Junio C Hamanobfd91f42018-08-17 22:21:161344</div>
Junio C Hamano2ba14712019-04-25 10:12:271345<div class="sect2">
1346<h3 id="_post_index_change">post-index-change</h3>
1347<div class="paragraph"><p>This hook is invoked when the index is written in read-cache.c
1348do_write_locked_index.</p></div>
1349<div class="paragraph"><p>The first parameter passed to the hook is the indicator for the
1350working directory being updated. "1" meaning working directory
1351was updated or "0" when the working directory was not updated.</p></div>
1352<div class="paragraph"><p>The second parameter passed to the hook is the indicator for whether
1353or not the index was updated and the skip-worktree bit could have
1354changed. "1" meaning skip-worktree bits could have been updated
1355and "0" meaning they were not.</p></div>
1356<div class="paragraph"><p>Only one parameter should be set to "1" when the hook runs. The hook
1357running passing "1", "1" should not be possible.</p></div>
1358</div>
Junio C Hamano9d971152012-12-19 00:43:111359</div>
1360</div>
1361<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311362<h2 id="_git">GIT</h2>
Junio C Hamano2fbcd212008-05-14 22:26:071363<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231364<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano2fbcd212008-05-14 22:26:071365</div>
Junio C Hamano7bd050f2011-09-22 06:32:221366</div>
Junio C Hamano9d971152012-12-19 00:43:111367</div>
Junio C Hamano7bd050f2011-09-22 06:32:221368<div id="footnotes"><hr /></div>
Junio C Hamano2fbcd212008-05-14 22:26:071369<div id="footer">
1370<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:531371Last updated
Junio C Hamanodf3d3cd2020-11-02 22:05:051372 2020-11-02 14:02:22 PST
Junio C Hamano2fbcd212008-05-14 22:26:071373</div>
1374</div>
1375</body>
1376</html>