Autogenerated HTML docs for v1.7.4-rc2-20-g8c0db6
[git/jnareb-git.git] / githooks.html
blob87964697fa0595fbdc87baf8d05ad29c3988857b
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">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <meta name="generator" content="AsciiDoc 8.4.5" />
7 <title>githooks(5)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.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 {
121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
129 div.content { /* Block element content. */
130 padding: 0;
133 /* Block element titles. */
134 div.title, caption.title {
135 color: #527bbd;
136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
142 div.title + * {
143 margin-top: 0;
146 td div.title:first-child {
147 margin-top: 0.0em;
149 div.content div.title:first-child {
150 margin-top: 0.0em;
152 div.content + div.title {
153 margin-top: 0.0em;
156 div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
162 div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
168 div.quoteblock {
169 padding-left: 2.0em;
170 margin-right: 10%;
172 div.quoteblock > div.attribution {
173 padding-top: 0.5em;
174 text-align: right;
177 div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
181 div.verseblock > div.content {
182 white-space: pre;
184 div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div.verseblock + div.attribution {
190 text-align: left;
193 div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
201 div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
206 div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
211 div.imageblock div.content { padding-left: 0; }
212 span.image img { border-style: none; }
213 a.image:visited { color: white; }
215 dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
219 dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
222 font-style: normal;
223 color: navy;
225 dd > *:first-child {
226 margin-top: 0.1em;
229 ul, ol {
230 list-style-position: outside;
232 ol.arabic {
233 list-style-type: decimal;
235 ol.loweralpha {
236 list-style-type: lower-alpha;
238 ol.upperalpha {
239 list-style-type: upper-alpha;
241 ol.lowerroman {
242 list-style-type: lower-roman;
244 ol.upperroman {
245 list-style-type: upper-roman;
248 div.compact ul, div.compact ol,
249 div.compact p, div.compact p,
250 div.compact div, div.compact div {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
255 div.tableblock > table {
256 border: 3px solid #527bbd;
258 thead {
259 font-family: sans-serif;
260 font-weight: bold;
262 tfoot {
263 font-weight: bold;
265 td > div.verse {
266 white-space: pre;
268 p.table {
269 margin-top: 0;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div.tableblock > table[frame="void"] {
273 border-style: none;
275 div.tableblock > table[frame="hsides"] {
276 border-left-style: none;
277 border-right-style: none;
279 div.tableblock > table[frame="vsides"] {
280 border-top-style: none;
281 border-bottom-style: none;
285 div.hdlist {
286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
289 div.hdlist tr {
290 padding-bottom: 15px;
292 dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
295 td.hdlist1 {
296 vertical-align: top;
297 font-style: normal;
298 padding-right: 0.8em;
299 color: navy;
301 td.hdlist2 {
302 vertical-align: top;
304 div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
309 .comment {
310 background: yellow;
313 @media print {
314 div#footer-badges { display: none; }
317 div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
326 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
330 div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
334 div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
338 div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
342 /* Overrides for manpage documents */
343 h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
349 h2 {
350 border-style: none;
352 div.sectionbody {
353 margin-left: 5%;
356 @media print {
357 div#toc { display: none; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
367 div.sidebar-title, div.image-title {
368 color: #527bbd;
369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
375 div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
381 div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
386 div.verseblock-content {
387 white-space: pre;
389 div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
394 div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc a:visited { color: blue; }
401 </style>
402 </head>
403 <body>
404 <div id="header">
405 <h1>
406 githooks(5) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>githooks -
411 Hooks used by git
412 </p>
413 </div>
414 </div>
415 <h2 id="_synopsis">SYNOPSIS</h2>
416 <div class="sectionbody">
417 <div class="paragraph"><p>$GIT_DIR/hooks/*</p></div>
418 </div>
419 <h2 id="_description">DESCRIPTION</h2>
420 <div class="sectionbody">
421 <div class="paragraph"><p>Hooks are little scripts you can place in <tt>$GIT_DIR/hooks</tt>
422 directory to trigger action at certain points. When
423 <em>git init</em> is run, a handful of example hooks are copied into the
424 <tt>hooks</tt> directory of the new repository, but by default they are
425 all disabled. To enable a hook, rename it by removing its <tt>.sample</tt>
426 suffix.</p></div>
427 <div class="admonitionblock">
428 <table><tr>
429 <td class="icon">
430 <div class="title">Note</div>
431 </td>
432 <td class="content">It is also a requirement for a given hook to be executable.
433 However - in a freshly initialized repository - the <tt>.sample</tt> files are
434 executable by default.</td>
435 </tr></table>
436 </div>
437 <div class="paragraph"><p>This document describes the currently defined hooks.</p></div>
438 </div>
439 <h2 id="_hooks">HOOKS</h2>
440 <div class="sectionbody">
441 <h3 id="_applypatch_msg">applypatch-msg</h3><div style="clear:left"></div>
442 <div class="paragraph"><p>This hook is invoked by <em>git am</em> script. It takes a single
443 parameter, the name of the file that holds the proposed commit
444 log message. Exiting with non-zero status causes
445 <em>git am</em> to abort before applying the patch.</p></div>
446 <div class="paragraph"><p>The hook is allowed to edit the message file in place, and can
447 be used to normalize the message into some project standard
448 format (if the project has one). It can also be used to refuse
449 the commit after inspecting the message file.</p></div>
450 <div class="paragraph"><p>The default <em>applypatch-msg</em> hook, when enabled, runs the
451 <em>commit-msg</em> hook, if the latter is enabled.</p></div>
452 <h3 id="_pre_applypatch">pre-applypatch</h3><div style="clear:left"></div>
453 <div class="paragraph"><p>This hook is invoked by <em>git am</em>. It takes no parameter, and is
454 invoked after the patch is applied, but before a commit is made.</p></div>
455 <div class="paragraph"><p>If it exits with non-zero status, then the working tree will not be
456 committed after applying the patch.</p></div>
457 <div class="paragraph"><p>It can be used to inspect the current working tree and refuse to
458 make a commit if it does not pass certain test.</p></div>
459 <div class="paragraph"><p>The default <em>pre-applypatch</em> hook, when enabled, runs the
460 <em>pre-commit</em> hook, if the latter is enabled.</p></div>
461 <h3 id="_post_applypatch">post-applypatch</h3><div style="clear:left"></div>
462 <div class="paragraph"><p>This hook is invoked by <em>git am</em>. It takes no parameter,
463 and is invoked after the patch is applied and a commit is made.</p></div>
464 <div class="paragraph"><p>This hook is meant primarily for notification, and cannot affect
465 the outcome of <em>git am</em>.</p></div>
466 <h3 id="_pre_commit">pre-commit</h3><div style="clear:left"></div>
467 <div class="paragraph"><p>This hook is invoked by <em>git commit</em>, and can be bypassed
468 with <tt>--no-verify</tt> option. It takes no parameter, and is
469 invoked before obtaining the proposed commit log message and
470 making a commit. Exiting with non-zero status from this script
471 causes the <em>git commit</em> to abort.</p></div>
472 <div class="paragraph"><p>The default <em>pre-commit</em> hook, when enabled, catches introduction
473 of lines with trailing whitespaces and aborts the commit when
474 such a line is found.</p></div>
475 <div class="paragraph"><p>All the <em>git commit</em> hooks are invoked with the environment
476 variable <tt>GIT_EDITOR=:</tt> if the command will not bring up an editor
477 to modify the commit message.</p></div>
478 <h3 id="_prepare_commit_msg">prepare-commit-msg</h3><div style="clear:left"></div>
479 <div class="paragraph"><p>This hook is invoked by <em>git commit</em> right after preparing the
480 default log message, and before the editor is started.</p></div>
481 <div class="paragraph"><p>It takes one to three parameters. The first is the name of the file
482 that contains the commit log message. The second is the source of the commit
483 message, and can be: <tt>message</tt> (if a <tt>-m</tt> or <tt>-F</tt> option was
484 given); <tt>template</tt> (if a <tt>-t</tt> option was given or the
485 configuration option <tt>commit.template</tt> is set); <tt>merge</tt> (if the
486 commit is a merge or a <tt>.git/MERGE_MSG</tt> file exists); <tt>squash</tt>
487 (if a <tt>.git/SQUASH_MSG</tt> file exists); or <tt>commit</tt>, followed by
488 a commit SHA1 (if a <tt>-c</tt>, <tt>-C</tt> or <tt>--amend</tt> option was given).</p></div>
489 <div class="paragraph"><p>If the exit status is non-zero, <em>git commit</em> will abort.</p></div>
490 <div class="paragraph"><p>The purpose of the hook is to edit the message file in place, and
491 it is not suppressed by the <tt>--no-verify</tt> option. A non-zero exit
492 means a failure of the hook and aborts the commit. It should not
493 be used as replacement for pre-commit hook.</p></div>
494 <div class="paragraph"><p>The sample <tt>prepare-commit-msg</tt> hook that comes with git comments
495 out the <tt>Conflicts:</tt> part of a merge&#8217;s commit message.</p></div>
496 <h3 id="_commit_msg">commit-msg</h3><div style="clear:left"></div>
497 <div class="paragraph"><p>This hook is invoked by <em>git commit</em>, and can be bypassed
498 with <tt>--no-verify</tt> option. It takes a single parameter, the
499 name of the file that holds the proposed commit log message.
500 Exiting with non-zero status causes the <em>git commit</em> to
501 abort.</p></div>
502 <div class="paragraph"><p>The hook is allowed to edit the message file in place, and can
503 be used to normalize the message into some project standard
504 format (if the project has one). It can also be used to refuse
505 the commit after inspecting the message file.</p></div>
506 <div class="paragraph"><p>The default <em>commit-msg</em> hook, when enabled, detects duplicate
507 "Signed-off-by" lines, and aborts the commit if one is found.</p></div>
508 <h3 id="_post_commit">post-commit</h3><div style="clear:left"></div>
509 <div class="paragraph"><p>This hook is invoked by <em>git commit</em>. It takes no
510 parameter, and is invoked after a commit is made.</p></div>
511 <div class="paragraph"><p>This hook is meant primarily for notification, and cannot affect
512 the outcome of <em>git commit</em>.</p></div>
513 <h3 id="_pre_rebase">pre-rebase</h3><div style="clear:left"></div>
514 <div class="paragraph"><p>This hook is called by <em>git rebase</em> and can be used to prevent a branch
515 from getting rebased.</p></div>
516 <h3 id="_post_checkout">post-checkout</h3><div style="clear:left"></div>
517 <div class="paragraph"><p>This hook is invoked when a <em>git checkout</em> is run after having updated the
518 worktree. The hook is given three parameters: the ref of the previous HEAD,
519 the ref of the new HEAD (which may or may not have changed), and a flag
520 indicating whether the checkout was a branch checkout (changing branches,
521 flag=1) or a file checkout (retrieving a file from the index, flag=0).
522 This hook cannot affect the outcome of <em>git checkout</em>.</p></div>
523 <div class="paragraph"><p>It is also run after <em>git clone</em>, unless the --no-checkout (-n) option is
524 used. The first parameter given to the hook is the null-ref, the second the
525 ref of the new HEAD and the flag is always 1.</p></div>
526 <div class="paragraph"><p>This hook can be used to perform repository validity checks, auto-display
527 differences from the previous HEAD if different, or set working dir metadata
528 properties.</p></div>
529 <h3 id="_post_merge">post-merge</h3><div style="clear:left"></div>
530 <div class="paragraph"><p>This hook is invoked by <em>git merge</em>, which happens when a <em>git pull</em>
531 is done on a local repository. The hook takes a single parameter, a status
532 flag specifying whether or not the merge being done was a squash merge.
533 This hook cannot affect the outcome of <em>git merge</em> and is not executed,
534 if the merge failed due to conflicts.</p></div>
535 <div class="paragraph"><p>This hook can be used in conjunction with a corresponding pre-commit hook to
536 save and restore any form of metadata associated with the working tree
537 (eg: permissions/ownership, ACLS, etc). See contrib/hooks/setgitperms.perl
538 for an example of how to do this.</p></div>
539 <h3 id="pre-receive">pre-receive</h3><div style="clear:left"></div>
540 <div class="paragraph"><p>This hook is invoked by <em>git-receive-pack</em> on the remote repository,
541 which happens when a <em>git push</em> is done on a local repository.
542 Just before starting to update refs on the remote repository, the
543 pre-receive hook is invoked. Its exit status determines the success
544 or failure of the update.</p></div>
545 <div class="paragraph"><p>This hook executes once for the receive operation. It takes no
546 arguments, but for each ref to be updated it receives on standard
547 input a line of the format:</p></div>
548 <div class="literalblock">
549 <div class="content">
550 <pre><tt>&lt;old-value&gt; SP &lt;new-value&gt; SP &lt;ref-name&gt; LF</tt></pre>
551 </div></div>
552 <div class="paragraph"><p>where <tt>&lt;old-value&gt;</tt> is the old object name stored in the ref,
553 <tt>&lt;new-value&gt;</tt> is the new object name to be stored in the ref and
554 <tt>&lt;ref-name&gt;</tt> is the full name of the ref.
555 When creating a new ref, <tt>&lt;old-value&gt;</tt> is 40 <tt>0</tt>.</p></div>
556 <div class="paragraph"><p>If the hook exits with non-zero status, none of the refs will be
557 updated. If the hook exits with zero, updating of individual refs can
558 still be prevented by the <a href="#update"><em>update</em></a> hook.</p></div>
559 <div class="paragraph"><p>Both standard output and standard error output are forwarded to
560 <em>git send-pack</em> on the other end, so you can simply <tt>echo</tt> messages
561 for the user.</p></div>
562 <h3 id="update">update</h3><div style="clear:left"></div>
563 <div class="paragraph"><p>This hook is invoked by <em>git-receive-pack</em> on the remote repository,
564 which happens when a <em>git push</em> is done on a local repository.
565 Just before updating the ref on the remote repository, the update hook
566 is invoked. Its exit status determines the success or failure of
567 the ref update.</p></div>
568 <div class="paragraph"><p>The hook executes once for each ref to be updated, and takes
569 three parameters:</p></div>
570 <div class="ulist"><ul>
571 <li>
573 the name of the ref being updated,
574 </p>
575 </li>
576 <li>
578 the old object name stored in the ref,
579 </p>
580 </li>
581 <li>
583 and the new objectname to be stored in the ref.
584 </p>
585 </li>
586 </ul></div>
587 <div class="paragraph"><p>A zero exit from the update hook allows the ref to be updated.
588 Exiting with a non-zero status prevents <em>git-receive-pack</em>
589 from updating that ref.</p></div>
590 <div class="paragraph"><p>This hook can be used to prevent <em>forced</em> update on certain refs by
591 making sure that the object name is a commit object that is a
592 descendant of the commit object named by the old object name.
593 That is, to enforce a "fast-forward only" policy.</p></div>
594 <div class="paragraph"><p>It could also be used to log the old..new status. However, it
595 does not know the entire set of branches, so it would end up
596 firing one e-mail per ref when used naively, though. The
597 <a href="#post-receive"><em>post-receive</em></a> hook is more suited to that.</p></div>
598 <div class="paragraph"><p>Another use suggested on the mailing list is to use this hook to
599 implement access control which is finer grained than the one
600 based on filesystem group.</p></div>
601 <div class="paragraph"><p>Both standard output and standard error output are forwarded to
602 <em>git send-pack</em> on the other end, so you can simply <tt>echo</tt> messages
603 for the user.</p></div>
604 <div class="paragraph"><p>The default <em>update</em> hook, when enabled&#8212;and with
605 <tt>hooks.allowunannotated</tt> config option unset or set to false&#8212;prevents
606 unannotated tags to be pushed.</p></div>
607 <h3 id="post-receive">post-receive</h3><div style="clear:left"></div>
608 <div class="paragraph"><p>This hook is invoked by <em>git-receive-pack</em> on the remote repository,
609 which happens when a <em>git push</em> is done on a local repository.
610 It executes on the remote repository once after all the refs have
611 been updated.</p></div>
612 <div class="paragraph"><p>This hook executes once for the receive operation. It takes no
613 arguments, but gets the same information as the
614 <a href="#pre-receive"><em>pre-receive</em></a>
615 hook does on its standard input.</p></div>
616 <div class="paragraph"><p>This hook does not affect the outcome of <em>git-receive-pack</em>, as it
617 is called after the real work is done.</p></div>
618 <div class="paragraph"><p>This supersedes the <a href="#post-update"><em>post-update</em></a> hook in that it gets
619 both old and new values of all the refs in addition to their
620 names.</p></div>
621 <div class="paragraph"><p>Both standard output and standard error output are forwarded to
622 <em>git send-pack</em> on the other end, so you can simply <tt>echo</tt> messages
623 for the user.</p></div>
624 <div class="paragraph"><p>The default <em>post-receive</em> hook is empty, but there is
625 a sample script <tt>post-receive-email</tt> provided in the <tt>contrib/hooks</tt>
626 directory in git distribution, which implements sending commit
627 emails.</p></div>
628 <h3 id="post-update">post-update</h3><div style="clear:left"></div>
629 <div class="paragraph"><p>This hook is invoked by <em>git-receive-pack</em> on the remote repository,
630 which happens when a <em>git push</em> is done on a local repository.
631 It executes on the remote repository once after all the refs have
632 been updated.</p></div>
633 <div class="paragraph"><p>It takes a variable number of parameters, each of which is the
634 name of ref that was actually updated.</p></div>
635 <div class="paragraph"><p>This hook is meant primarily for notification, and cannot affect
636 the outcome of <em>git-receive-pack</em>.</p></div>
637 <div class="paragraph"><p>The <em>post-update</em> hook can tell what are the heads that were pushed,
638 but it does not know what their original and updated values are,
639 so it is a poor place to do log old..new. The
640 <a href="#post-receive"><em>post-receive</em></a> hook does get both original and
641 updated values of the refs. You might consider it instead if you need
642 them.</p></div>
643 <div class="paragraph"><p>When enabled, the default <em>post-update</em> hook runs
644 <em>git update-server-info</em> to keep the information used by dumb
645 transports (e.g., HTTP) up-to-date. If you are publishing
646 a git repository that is accessible via HTTP, you should
647 probably enable this hook.</p></div>
648 <div class="paragraph"><p>Both standard output and standard error output are forwarded to
649 <em>git send-pack</em> on the other end, so you can simply <tt>echo</tt> messages
650 for the user.</p></div>
651 <h3 id="_pre_auto_gc">pre-auto-gc</h3><div style="clear:left"></div>
652 <div class="paragraph"><p>This hook is invoked by <em>git gc --auto</em>. It takes no parameter, and
653 exiting with non-zero status from this script causes the <em>git gc --auto</em>
654 to abort.</p></div>
655 <h3 id="_post_rewrite">post-rewrite</h3><div style="clear:left"></div>
656 <div class="paragraph"><p>This hook is invoked by commands that rewrite commits (<tt>git commit
657 --amend</tt>, <em>git-rebase</em>; currently <em>git-filter-branch</em> does <em>not</em> call
658 it!). Its first argument denotes the command it was invoked by:
659 currently one of <tt>amend</tt> or <tt>rebase</tt>. Further command-dependent
660 arguments may be passed in the future.</p></div>
661 <div class="paragraph"><p>The hook receives a list of the rewritten commits on stdin, in the
662 format</p></div>
663 <div class="literalblock">
664 <div class="content">
665 <pre><tt>&lt;old-sha1&gt; SP &lt;new-sha1&gt; [ SP &lt;extra-info&gt; ] LF</tt></pre>
666 </div></div>
667 <div class="paragraph"><p>The <em>extra-info</em> is again command-dependent. If it is empty, the
668 preceding SP is also omitted. Currently, no commands pass any
669 <em>extra-info</em>.</p></div>
670 <div class="paragraph"><p>The hook always runs after the automatic note copying (see
671 "notes.rewrite.&lt;command&gt;" in linkgit:git-config.txt) has happened, and
672 thus has access to these notes.</p></div>
673 <div class="paragraph"><p>The following command-specific comments apply:</p></div>
674 <div class="dlist"><dl>
675 <dt class="hdlist1">
676 rebase
677 </dt>
678 <dd>
680 For the <em>squash</em> and <em>fixup</em> operation, all commits that were
681 squashed are listed as being rewritten to the squashed commit.
682 This means that there will be several lines sharing the same
683 <em>new-sha1</em>.
684 </p>
685 <div class="paragraph"><p>The commits are guaranteed to be listed in the order that they were
686 processed by rebase.</p></div>
687 </dd>
688 </dl></div>
689 </div>
690 <h2 id="_git">GIT</h2>
691 <div class="sectionbody">
692 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
693 </div>
694 <div id="footer">
695 <div id="footer-text">
696 Last updated 2011-01-12 09:08:33 UTC
697 </div>
698 </div>
699 </body>
700 </html>