Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 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> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 5 | <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> |
| 6 | <meta name="generator" content="AsciiDoc 8.6.8" /> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 7 | <title>githooks(5)</title> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 8 | <style type="text/css"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 9 | /* Shared CSS for AsciiDoc xhtml11 and html5 backends */ |
| 10 | |
| 11 | /* Default font. */ |
| 12 | body { |
| 13 | font-family: Georgia,serif; |
| 14 | } |
| 15 | |
| 16 | /* Title font. */ |
| 17 | h1, h2, h3, h4, h5, h6, |
| 18 | div.title, caption.title, |
| 19 | thead, p.table.header, |
| 20 | #toctitle, |
| 21 | #author, #revnumber, #revdate, #revremark, |
| 22 | #footer { |
| 23 | font-family: Arial,Helvetica,sans-serif; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | body { |
| 27 | margin: 1em 5% 1em 5%; |
| 28 | } |
| 29 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 30 | a { |
| 31 | color: blue; |
| 32 | text-decoration: underline; |
| 33 | } |
| 34 | a:visited { |
| 35 | color: fuchsia; |
| 36 | } |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 37 | |
| 38 | em { |
| 39 | font-style: italic; |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 40 | color: navy; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | strong { |
| 44 | font-weight: bold; |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 45 | color: #083194; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 46 | } |
| 47 | |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 48 | h1, h2, h3, h4, h5, h6 { |
| 49 | color: #527bbd; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 50 | margin-top: 1.2em; |
| 51 | margin-bottom: 0.5em; |
| 52 | line-height: 1.3; |
| 53 | } |
| 54 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 55 | h1, h2, h3 { |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 56 | border-bottom: 2px solid silver; |
| 57 | } |
| 58 | h2 { |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 59 | padding-top: 0.5em; |
| 60 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 61 | h3 { |
| 62 | float: left; |
| 63 | } |
| 64 | h3 + * { |
| 65 | clear: left; |
| 66 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 67 | h5 { |
| 68 | font-size: 1.0em; |
| 69 | } |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 70 | |
| 71 | div.sectionbody { |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 72 | margin-left: 0; |
| 73 | } |
| 74 | |
| 75 | hr { |
| 76 | border: 1px solid silver; |
| 77 | } |
| 78 | |
| 79 | p { |
| 80 | margin-top: 0.5em; |
| 81 | margin-bottom: 0.5em; |
| 82 | } |
| 83 | |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 84 | ul, ol, li > p { |
| 85 | margin-top: 0; |
| 86 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 87 | ul > li { color: #aaa; } |
| 88 | ul > li > * { color: black; } |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 89 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 90 | .monospaced, code, pre { |
| 91 | font-family: "Courier New", Courier, monospace; |
| 92 | font-size: inherit; |
| 93 | color: navy; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 94 | padding: 0; |
| 95 | margin: 0; |
| 96 | } |
| 97 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 98 | |
| 99 | #author { |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 100 | color: #527bbd; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 101 | font-weight: bold; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 102 | font-size: 1.1em; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 103 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 104 | #email { |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 105 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 106 | #revnumber, #revdate, #revremark { |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 107 | } |
| 108 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 109 | #footer { |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 110 | font-size: small; |
| 111 | border-top: 2px solid silver; |
| 112 | padding-top: 0.5em; |
| 113 | margin-top: 4.0em; |
| 114 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 115 | #footer-text { |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 116 | float: left; |
| 117 | padding-bottom: 0.5em; |
| 118 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 119 | #footer-badges { |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 120 | float: right; |
| 121 | padding-bottom: 0.5em; |
| 122 | } |
| 123 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 124 | #preamble { |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 125 | margin-top: 1.5em; |
| 126 | margin-bottom: 1.5em; |
| 127 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 128 | div.imageblock, div.exampleblock, div.verseblock, |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 129 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 130 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 131 | margin-top: 1.0em; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 132 | margin-bottom: 1.5em; |
| 133 | } |
| 134 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 135 | margin-top: 2.0em; |
| 136 | margin-bottom: 2.0em; |
| 137 | margin-right: 10%; |
| 138 | color: #606060; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | div.content { /* Block element content. */ |
| 142 | padding: 0; |
| 143 | } |
| 144 | |
| 145 | /* Block element titles. */ |
| 146 | div.title, caption.title { |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 147 | color: #527bbd; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 148 | font-weight: bold; |
| 149 | text-align: left; |
| 150 | margin-top: 1.0em; |
| 151 | margin-bottom: 0.5em; |
| 152 | } |
| 153 | div.title + * { |
| 154 | margin-top: 0; |
| 155 | } |
| 156 | |
| 157 | td div.title:first-child { |
| 158 | margin-top: 0.0em; |
| 159 | } |
| 160 | div.content div.title:first-child { |
| 161 | margin-top: 0.0em; |
| 162 | } |
| 163 | div.content + div.title { |
| 164 | margin-top: 0.0em; |
| 165 | } |
| 166 | |
| 167 | div.sidebarblock > div.content { |
| 168 | background: #ffffee; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 169 | border: 1px solid #dddddd; |
| 170 | border-left: 4px solid #f0f0f0; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 171 | padding: 0.5em; |
| 172 | } |
| 173 | |
| 174 | div.listingblock > div.content { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 175 | border: 1px solid #dddddd; |
| 176 | border-left: 5px solid #f0f0f0; |
| 177 | background: #f8f8f8; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 178 | padding: 0.5em; |
| 179 | } |
| 180 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 181 | div.quoteblock, div.verseblock { |
| 182 | padding-left: 1.0em; |
| 183 | margin-left: 1.0em; |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 184 | margin-right: 10%; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 185 | border-left: 5px solid #f0f0f0; |
| 186 | color: #888; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 187 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 188 | |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 189 | div.quoteblock > div.attribution { |
| 190 | padding-top: 0.5em; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 191 | text-align: right; |
| 192 | } |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 193 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 194 | div.verseblock > pre.content { |
| 195 | font-family: inherit; |
| 196 | font-size: inherit; |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 197 | } |
| 198 | div.verseblock > div.attribution { |
| 199 | padding-top: 0.75em; |
| 200 | text-align: left; |
| 201 | } |
| 202 | /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 203 | div.verseblock + div.attribution { |
| 204 | text-align: left; |
| 205 | } |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 206 | |
| 207 | div.admonitionblock .icon { |
| 208 | vertical-align: top; |
| 209 | font-size: 1.1em; |
| 210 | font-weight: bold; |
| 211 | text-decoration: underline; |
| 212 | color: #527bbd; |
| 213 | padding-right: 0.5em; |
| 214 | } |
| 215 | div.admonitionblock td.content { |
| 216 | padding-left: 0.5em; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 217 | border-left: 3px solid #dddddd; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | div.exampleblock > div.content { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 221 | border-left: 3px solid #dddddd; |
| 222 | padding-left: 0.5em; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 223 | } |
| 224 | |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 225 | div.imageblock div.content { padding-left: 0; } |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 226 | span.image img { border-style: none; } |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 227 | a.image:visited { color: white; } |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 228 | |
| 229 | dl { |
| 230 | margin-top: 0.8em; |
| 231 | margin-bottom: 0.8em; |
| 232 | } |
| 233 | dt { |
| 234 | margin-top: 0.5em; |
| 235 | margin-bottom: 0; |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 236 | font-style: normal; |
| 237 | color: navy; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 238 | } |
| 239 | dd > *:first-child { |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 240 | margin-top: 0.1em; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | ul, ol { |
| 244 | list-style-position: outside; |
| 245 | } |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 246 | ol.arabic { |
| 247 | list-style-type: decimal; |
| 248 | } |
| 249 | ol.loweralpha { |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 250 | list-style-type: lower-alpha; |
| 251 | } |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 252 | ol.upperalpha { |
| 253 | list-style-type: upper-alpha; |
| 254 | } |
| 255 | ol.lowerroman { |
| 256 | list-style-type: lower-roman; |
| 257 | } |
| 258 | ol.upperroman { |
| 259 | list-style-type: upper-roman; |
| 260 | } |
| 261 | |
| 262 | div.compact ul, div.compact ol, |
| 263 | div.compact p, div.compact p, |
| 264 | div.compact div, div.compact div { |
| 265 | margin-top: 0.1em; |
| 266 | margin-bottom: 0.1em; |
| 267 | } |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 268 | |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 269 | tfoot { |
| 270 | font-weight: bold; |
| 271 | } |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 272 | td > div.verse { |
| 273 | white-space: pre; |
| 274 | } |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 275 | |
| 276 | div.hdlist { |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 277 | margin-top: 0.8em; |
| 278 | margin-bottom: 0.8em; |
| 279 | } |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 280 | div.hdlist tr { |
| 281 | padding-bottom: 15px; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 282 | } |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 283 | dt.hdlist1.strong, td.hdlist1.strong { |
| 284 | font-weight: bold; |
| 285 | } |
| 286 | td.hdlist1 { |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 287 | vertical-align: top; |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 288 | font-style: normal; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 289 | padding-right: 0.8em; |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 290 | color: navy; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 291 | } |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 292 | td.hdlist2 { |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 293 | vertical-align: top; |
| 294 | } |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 295 | div.hdlist.compact tr { |
| 296 | margin: 0; |
| 297 | padding-bottom: 0; |
| 298 | } |
| 299 | |
| 300 | .comment { |
| 301 | background: yellow; |
| 302 | } |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 303 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 304 | .footnote, .footnoteref { |
| 305 | font-size: 0.8em; |
| 306 | } |
| 307 | |
| 308 | span.footnote, span.footnoteref { |
| 309 | vertical-align: super; |
| 310 | } |
| 311 | |
| 312 | #footnotes { |
| 313 | margin: 20px 0 20px 0; |
| 314 | padding: 7px 0 0 0; |
| 315 | } |
| 316 | |
| 317 | #footnotes div.footnote { |
| 318 | margin: 0 0 5px 0; |
| 319 | } |
| 320 | |
| 321 | #footnotes hr { |
| 322 | border: none; |
| 323 | border-top: 1px solid silver; |
| 324 | height: 1px; |
| 325 | text-align: left; |
| 326 | margin-left: 0; |
| 327 | width: 20%; |
| 328 | min-width: 100px; |
| 329 | } |
| 330 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 331 | div.colist td { |
| 332 | padding-right: 0.5em; |
| 333 | padding-bottom: 0.3em; |
| 334 | vertical-align: top; |
| 335 | } |
| 336 | div.colist td img { |
| 337 | margin-top: 0.3em; |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 338 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 339 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 340 | @media print { |
| 341 | #footer-badges { display: none; } |
| 342 | } |
| 343 | |
| 344 | #toc { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 345 | margin-bottom: 2.5em; |
| 346 | } |
| 347 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 348 | #toctitle { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 349 | color: #527bbd; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 350 | font-size: 1.1em; |
| 351 | font-weight: bold; |
| 352 | margin-top: 1.0em; |
| 353 | margin-bottom: 0.1em; |
| 354 | } |
| 355 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 356 | div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 357 | margin-top: 0; |
| 358 | margin-bottom: 0; |
| 359 | } |
| 360 | div.toclevel2 { |
| 361 | margin-left: 2em; |
| 362 | font-size: 0.9em; |
| 363 | } |
| 364 | div.toclevel3 { |
| 365 | margin-left: 4em; |
| 366 | font-size: 0.9em; |
| 367 | } |
| 368 | div.toclevel4 { |
| 369 | margin-left: 6em; |
| 370 | font-size: 0.9em; |
| 371 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 372 | |
| 373 | span.aqua { color: aqua; } |
| 374 | span.black { color: black; } |
| 375 | span.blue { color: blue; } |
| 376 | span.fuchsia { color: fuchsia; } |
| 377 | span.gray { color: gray; } |
| 378 | span.green { color: green; } |
| 379 | span.lime { color: lime; } |
| 380 | span.maroon { color: maroon; } |
| 381 | span.navy { color: navy; } |
| 382 | span.olive { color: olive; } |
| 383 | span.purple { color: purple; } |
| 384 | span.red { color: red; } |
| 385 | span.silver { color: silver; } |
| 386 | span.teal { color: teal; } |
| 387 | span.white { color: white; } |
| 388 | span.yellow { color: yellow; } |
| 389 | |
| 390 | span.aqua-background { background: aqua; } |
| 391 | span.black-background { background: black; } |
| 392 | span.blue-background { background: blue; } |
| 393 | span.fuchsia-background { background: fuchsia; } |
| 394 | span.gray-background { background: gray; } |
| 395 | span.green-background { background: green; } |
| 396 | span.lime-background { background: lime; } |
| 397 | span.maroon-background { background: maroon; } |
| 398 | span.navy-background { background: navy; } |
| 399 | span.olive-background { background: olive; } |
| 400 | span.purple-background { background: purple; } |
| 401 | span.red-background { background: red; } |
| 402 | span.silver-background { background: silver; } |
| 403 | span.teal-background { background: teal; } |
| 404 | span.white-background { background: white; } |
| 405 | span.yellow-background { background: yellow; } |
| 406 | |
| 407 | span.big { font-size: 2em; } |
| 408 | span.small { font-size: 0.6em; } |
| 409 | |
| 410 | span.underline { text-decoration: underline; } |
| 411 | span.overline { text-decoration: overline; } |
| 412 | span.line-through { text-decoration: line-through; } |
| 413 | |
| 414 | div.unbreakable { page-break-inside: avoid; } |
| 415 | |
| 416 | |
| 417 | /* |
| 418 | * xhtml11 specific |
| 419 | * |
| 420 | * */ |
| 421 | |
| 422 | div.tableblock { |
| 423 | margin-top: 1.0em; |
| 424 | margin-bottom: 1.5em; |
| 425 | } |
| 426 | div.tableblock > table { |
| 427 | border: 3px solid #527bbd; |
| 428 | } |
| 429 | thead, p.table.header { |
| 430 | font-weight: bold; |
| 431 | color: #527bbd; |
| 432 | } |
| 433 | p.table { |
| 434 | margin-top: 0; |
| 435 | } |
| 436 | /* Because the table frame attribute is overriden by CSS in most browsers. */ |
| 437 | div.tableblock > table[frame="void"] { |
| 438 | border-style: none; |
| 439 | } |
| 440 | div.tableblock > table[frame="hsides"] { |
| 441 | border-left-style: none; |
| 442 | border-right-style: none; |
| 443 | } |
| 444 | div.tableblock > table[frame="vsides"] { |
| 445 | border-top-style: none; |
| 446 | border-bottom-style: none; |
| 447 | } |
| 448 | |
| 449 | |
| 450 | /* |
| 451 | * html5 specific |
| 452 | * |
| 453 | * */ |
| 454 | |
| 455 | table.tableblock { |
| 456 | margin-top: 1.0em; |
| 457 | margin-bottom: 1.5em; |
| 458 | } |
| 459 | thead, p.tableblock.header { |
| 460 | font-weight: bold; |
| 461 | color: #527bbd; |
| 462 | } |
| 463 | p.tableblock { |
| 464 | margin-top: 0; |
| 465 | } |
| 466 | table.tableblock { |
| 467 | border-width: 3px; |
| 468 | border-spacing: 0px; |
| 469 | border-style: solid; |
| 470 | border-color: #527bbd; |
| 471 | border-collapse: collapse; |
| 472 | } |
| 473 | th.tableblock, td.tableblock { |
| 474 | border-width: 1px; |
| 475 | padding: 4px; |
| 476 | border-style: solid; |
| 477 | border-color: #527bbd; |
| 478 | } |
| 479 | |
| 480 | table.tableblock.frame-topbot { |
| 481 | border-left-style: hidden; |
| 482 | border-right-style: hidden; |
| 483 | } |
| 484 | table.tableblock.frame-sides { |
| 485 | border-top-style: hidden; |
| 486 | border-bottom-style: hidden; |
| 487 | } |
| 488 | table.tableblock.frame-none { |
| 489 | border-style: hidden; |
| 490 | } |
| 491 | |
| 492 | th.tableblock.halign-left, td.tableblock.halign-left { |
| 493 | text-align: left; |
| 494 | } |
| 495 | th.tableblock.halign-center, td.tableblock.halign-center { |
| 496 | text-align: center; |
| 497 | } |
| 498 | th.tableblock.halign-right, td.tableblock.halign-right { |
| 499 | text-align: right; |
| 500 | } |
| 501 | |
| 502 | th.tableblock.valign-top, td.tableblock.valign-top { |
| 503 | vertical-align: top; |
| 504 | } |
| 505 | th.tableblock.valign-middle, td.tableblock.valign-middle { |
| 506 | vertical-align: middle; |
| 507 | } |
| 508 | th.tableblock.valign-bottom, td.tableblock.valign-bottom { |
| 509 | vertical-align: bottom; |
| 510 | } |
| 511 | |
| 512 | |
| 513 | /* |
| 514 | * manpage specific |
| 515 | * |
| 516 | * */ |
| 517 | |
| 518 | body.manpage h1 { |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 519 | padding-top: 0.5em; |
| 520 | padding-bottom: 0.5em; |
| 521 | border-top: 2px solid silver; |
| 522 | border-bottom: 2px solid silver; |
| 523 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 524 | body.manpage h2 { |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 525 | border-style: none; |
| 526 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 527 | body.manpage div.sectionbody { |
| 528 | margin-left: 3em; |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 529 | } |
| 530 | |
| 531 | @media print { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 532 | body.manpage div#toc { display: none; } |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 533 | } |
| 534 | |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 535 | |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 536 | </style> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 537 | <script type="text/javascript"> |
| 538 | /*<![CDATA[*/ |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 539 | var asciidoc = { // Namespace. |
| 540 | |
| 541 | ///////////////////////////////////////////////////////////////////// |
| 542 | // Table Of Contents generator |
| 543 | ///////////////////////////////////////////////////////////////////// |
| 544 | |
| 545 | /* Author: Mihai Bazon, September 2002 |
| 546 | * http://students.infoiasi.ro/~mishoo |
| 547 | * |
| 548 | * Table Of Content generator |
| 549 | * Version: 0.4 |
| 550 | * |
| 551 | * Feel free to use this script under the terms of the GNU General Public |
| 552 | * License, as long as you do not remove or alter this notice. |
| 553 | */ |
| 554 | |
| 555 | /* modified by Troy D. Hanson, September 2006. License: GPL */ |
| 556 | /* modified by Stuart Rackham, 2006, 2009. License: GPL */ |
| 557 | |
| 558 | // toclevels = 1..4. |
| 559 | toc: function (toclevels) { |
| 560 | |
| 561 | function getText(el) { |
| 562 | var text = ""; |
| 563 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 564 | if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants. |
| 565 | text += i.data; |
| 566 | else if (i.firstChild != null) |
| 567 | text += getText(i); |
| 568 | } |
| 569 | return text; |
| 570 | } |
| 571 | |
| 572 | function TocEntry(el, text, toclevel) { |
| 573 | this.element = el; |
| 574 | this.text = text; |
| 575 | this.toclevel = toclevel; |
| 576 | } |
| 577 | |
| 578 | function tocEntries(el, toclevels) { |
| 579 | var result = new Array; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 580 | var re = new RegExp('[hH]([1-'+(toclevels+1)+'])'); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 581 | // Function that scans the DOM tree for header elements (the DOM2 |
| 582 | // nodeIterator API would be a better technique but not supported by all |
| 583 | // browsers). |
| 584 | var iterate = function (el) { |
| 585 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 586 | if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { |
| 587 | var mo = re.exec(i.tagName); |
| 588 | if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") { |
| 589 | result[result.length] = new TocEntry(i, getText(i), mo[1]-1); |
| 590 | } |
| 591 | iterate(i); |
| 592 | } |
| 593 | } |
| 594 | } |
| 595 | iterate(el); |
| 596 | return result; |
| 597 | } |
| 598 | |
| 599 | var toc = document.getElementById("toc"); |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 600 | if (!toc) { |
| 601 | return; |
| 602 | } |
| 603 | |
| 604 | // Delete existing TOC entries in case we're reloading the TOC. |
| 605 | var tocEntriesToRemove = []; |
| 606 | var i; |
| 607 | for (i = 0; i < toc.childNodes.length; i++) { |
| 608 | var entry = toc.childNodes[i]; |
| 609 | if (entry.nodeName.toLowerCase() == 'div' |
| 610 | && entry.getAttribute("class") |
| 611 | && entry.getAttribute("class").match(/^toclevel/)) |
| 612 | tocEntriesToRemove.push(entry); |
| 613 | } |
| 614 | for (i = 0; i < tocEntriesToRemove.length; i++) { |
| 615 | toc.removeChild(tocEntriesToRemove[i]); |
| 616 | } |
| 617 | |
| 618 | // Rebuild TOC entries. |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 619 | var entries = tocEntries(document.getElementById("content"), toclevels); |
| 620 | for (var i = 0; i < entries.length; ++i) { |
| 621 | var entry = entries[i]; |
| 622 | if (entry.element.id == "") |
| 623 | entry.element.id = "_toc_" + i; |
| 624 | var a = document.createElement("a"); |
| 625 | a.href = "#" + entry.element.id; |
| 626 | a.appendChild(document.createTextNode(entry.text)); |
| 627 | var div = document.createElement("div"); |
| 628 | div.appendChild(a); |
| 629 | div.className = "toclevel" + entry.toclevel; |
| 630 | toc.appendChild(div); |
| 631 | } |
| 632 | if (entries.length == 0) |
| 633 | toc.parentNode.removeChild(toc); |
| 634 | }, |
| 635 | |
| 636 | |
| 637 | ///////////////////////////////////////////////////////////////////// |
| 638 | // Footnotes generator |
| 639 | ///////////////////////////////////////////////////////////////////// |
| 640 | |
| 641 | /* Based on footnote generation code from: |
| 642 | * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html |
| 643 | */ |
| 644 | |
| 645 | footnotes: function () { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 646 | // Delete existing footnote entries in case we're reloading the footnodes. |
| 647 | var i; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 648 | var noteholder = document.getElementById("footnotes"); |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 649 | if (!noteholder) { |
| 650 | return; |
| 651 | } |
| 652 | var entriesToRemove = []; |
| 653 | for (i = 0; i < noteholder.childNodes.length; i++) { |
| 654 | var entry = noteholder.childNodes[i]; |
| 655 | if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote") |
| 656 | entriesToRemove.push(entry); |
| 657 | } |
| 658 | for (i = 0; i < entriesToRemove.length; i++) { |
| 659 | noteholder.removeChild(entriesToRemove[i]); |
| 660 | } |
| 661 | |
| 662 | // Rebuild footnote entries. |
| 663 | var cont = document.getElementById("content"); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 664 | var spans = cont.getElementsByTagName("span"); |
| 665 | var refs = {}; |
| 666 | var n = 0; |
| 667 | for (i=0; i<spans.length; i++) { |
| 668 | if (spans[i].className == "footnote") { |
| 669 | n++; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 670 | var note = spans[i].getAttribute("data-note"); |
| 671 | if (!note) { |
| 672 | // Use [\s\S] in place of . so multi-line matches work. |
| 673 | // Because JavaScript has no s (dotall) regex flag. |
| 674 | note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1]; |
| 675 | spans[i].innerHTML = |
| 676 | "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n + |
| 677 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 678 | spans[i].setAttribute("data-note", note); |
| 679 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 680 | noteholder.innerHTML += |
| 681 | "<div class='footnote' id='_footnote_" + n + "'>" + |
| 682 | "<a href='#_footnoteref_" + n + "' title='Return to text'>" + |
| 683 | n + "</a>. " + note + "</div>"; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 684 | var id =spans[i].getAttribute("id"); |
| 685 | if (id != null) refs["#"+id] = n; |
| 686 | } |
| 687 | } |
| 688 | if (n == 0) |
| 689 | noteholder.parentNode.removeChild(noteholder); |
| 690 | else { |
| 691 | // Process footnoterefs. |
| 692 | for (i=0; i<spans.length; i++) { |
| 693 | if (spans[i].className == "footnoteref") { |
| 694 | var href = spans[i].getElementsByTagName("a")[0].getAttribute("href"); |
| 695 | href = href.match(/#.*/)[0]; // Because IE return full URL. |
| 696 | n = refs[href]; |
| 697 | spans[i].innerHTML = |
| 698 | "[<a href='#_footnote_" + n + |
| 699 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 700 | } |
| 701 | } |
| 702 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 703 | }, |
| 704 | |
| 705 | install: function(toclevels) { |
| 706 | var timerId; |
| 707 | |
| 708 | function reinstall() { |
| 709 | asciidoc.footnotes(); |
| 710 | if (toclevels) { |
| 711 | asciidoc.toc(toclevels); |
| 712 | } |
| 713 | } |
| 714 | |
| 715 | function reinstallAndRemoveTimer() { |
| 716 | clearInterval(timerId); |
| 717 | reinstall(); |
| 718 | } |
| 719 | |
| 720 | timerId = setInterval(reinstall, 500); |
| 721 | if (document.addEventListener) |
| 722 | document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false); |
| 723 | else |
| 724 | window.onload = reinstallAndRemoveTimer; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 725 | } |
| 726 | |
| 727 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 728 | asciidoc.install(); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 729 | /*]]>*/ |
| 730 | </script> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 731 | </head> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 732 | <body class="manpage"> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 733 | <div id="header"> |
| 734 | <h1> |
| 735 | githooks(5) Manual Page |
| 736 | </h1> |
| 737 | <h2>NAME</h2> |
| 738 | <div class="sectionbody"> |
| 739 | <p>githooks - |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 740 | Hooks used by Git |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 741 | </p> |
| 742 | </div> |
| 743 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 744 | <div id="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 745 | <div class="sect1"> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 746 | <h2 id="_synopsis">SYNOPSIS</h2> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 747 | <div class="sectionbody"> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 748 | <div class="paragraph"><p>$GIT_DIR/hooks/*</p></div> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 749 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 750 | </div> |
| 751 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 752 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 753 | <div class="sectionbody"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 754 | <div class="paragraph"><p>Hooks are little scripts you can place in <code>$GIT_DIR/hooks</code> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 755 | directory to trigger action at certain points. When |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 756 | <em>git init</em> is run, a handful of example hooks are copied into the |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 757 | <code>hooks</code> directory of the new repository, but by default they are |
| 758 | all disabled. To enable a hook, rename it by removing its <code>.sample</code> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 759 | suffix.</p></div> |
Junio C Hamano | 8a48fa2 | 2008-12-18 08:44:30 | [diff] [blame] | 760 | <div class="admonitionblock"> |
| 761 | <table><tr> |
| 762 | <td class="icon"> |
| 763 | <div class="title">Note</div> |
| 764 | </td> |
| 765 | <td class="content">It is also a requirement for a given hook to be executable. |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 766 | However - in a freshly initialized repository - the <code>.sample</code> files are |
Junio C Hamano | 8a48fa2 | 2008-12-18 08:44:30 | [diff] [blame] | 767 | executable by default.</td> |
| 768 | </tr></table> |
| 769 | </div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 770 | <div class="paragraph"><p>This document describes the currently defined hooks.</p></div> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 771 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 772 | </div> |
| 773 | <div class="sect1"> |
Junio C Hamano | c28068f | 2009-09-08 00:55:23 | [diff] [blame] | 774 | <h2 id="_hooks">HOOKS</h2> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 775 | <div class="sectionbody"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 776 | <div class="sect2"> |
| 777 | <h3 id="_applypatch_msg">applypatch-msg</h3> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 778 | <div class="paragraph"><p>This hook is invoked by <em>git am</em> script. It takes a single |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 779 | parameter, the name of the file that holds the proposed commit |
| 780 | log message. Exiting with non-zero status causes |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 781 | <em>git am</em> to abort before applying the patch.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 782 | <div class="paragraph"><p>The hook is allowed to edit the message file in place, and can |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 783 | be used to normalize the message into some project standard |
| 784 | format (if the project has one). It can also be used to refuse |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 785 | the commit after inspecting the message file.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 786 | <div class="paragraph"><p>The default <em>applypatch-msg</em> hook, when enabled, runs the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 787 | <em>commit-msg</em> hook, if the latter is enabled.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 788 | </div> |
| 789 | <div class="sect2"> |
| 790 | <h3 id="_pre_applypatch">pre-applypatch</h3> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 791 | <div class="paragraph"><p>This hook is invoked by <em>git am</em>. It takes no parameter, and is |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 792 | invoked after the patch is applied, but before a commit is made.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 793 | <div class="paragraph"><p>If it exits with non-zero status, then the working tree will not be |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 794 | committed after applying the patch.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 795 | <div class="paragraph"><p>It can be used to inspect the current working tree and refuse to |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 796 | make a commit if it does not pass certain test.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 797 | <div class="paragraph"><p>The default <em>pre-applypatch</em> hook, when enabled, runs the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 798 | <em>pre-commit</em> hook, if the latter is enabled.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 799 | </div> |
| 800 | <div class="sect2"> |
| 801 | <h3 id="_post_applypatch">post-applypatch</h3> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 802 | <div class="paragraph"><p>This hook is invoked by <em>git am</em>. It takes no parameter, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 803 | and is invoked after the patch is applied and a commit is made.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 804 | <div class="paragraph"><p>This hook is meant primarily for notification, and cannot affect |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 805 | the outcome of <em>git am</em>.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 806 | </div> |
| 807 | <div class="sect2"> |
| 808 | <h3 id="_pre_commit">pre-commit</h3> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 809 | <div class="paragraph"><p>This hook is invoked by <em>git commit</em>, and can be bypassed |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 810 | with <code>--no-verify</code> option. It takes no parameter, and is |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 811 | invoked before obtaining the proposed commit log message and |
| 812 | making a commit. Exiting with non-zero status from this script |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 813 | causes the <em>git commit</em> to abort.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 814 | <div class="paragraph"><p>The default <em>pre-commit</em> hook, when enabled, catches introduction |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 815 | of lines with trailing whitespaces and aborts the commit when |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 816 | such a line is found.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 817 | <div class="paragraph"><p>All the <em>git commit</em> hooks are invoked with the environment |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 818 | variable <code>GIT_EDITOR=:</code> if the command will not bring up an editor |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 819 | to modify the commit message.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 820 | </div> |
| 821 | <div class="sect2"> |
| 822 | <h3 id="_prepare_commit_msg">prepare-commit-msg</h3> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 823 | <div class="paragraph"><p>This hook is invoked by <em>git commit</em> right after preparing the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 824 | default log message, and before the editor is started.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 825 | <div class="paragraph"><p>It takes one to three parameters. The first is the name of the file |
Junio C Hamano | bd53dbf | 2009-01-18 18:26:37 | [diff] [blame] | 826 | that contains the commit log message. The second is the source of the commit |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 827 | message, and can be: <code>message</code> (if a <code>-m</code> or <code>-F</code> option was |
| 828 | given); <code>template</code> (if a <code>-t</code> option was given or the |
| 829 | configuration option <code>commit.template</code> is set); <code>merge</code> (if the |
| 830 | commit is a merge or a <code>.git/MERGE_MSG</code> file exists); <code>squash</code> |
| 831 | (if a <code>.git/SQUASH_MSG</code> file exists); or <code>commit</code>, followed by |
| 832 | a commit SHA1 (if a <code>-c</code>, <code>-C</code> or <code>--amend</code> option was given).</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 833 | <div class="paragraph"><p>If the exit status is non-zero, <em>git commit</em> will abort.</p></div> |
| 834 | <div class="paragraph"><p>The purpose of the hook is to edit the message file in place, and |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 835 | it is not suppressed by the <code>--no-verify</code> option. A non-zero exit |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 836 | means a failure of the hook and aborts the commit. It should not |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 837 | be used as replacement for pre-commit hook.</p></div> |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 838 | <div class="paragraph"><p>The sample <code>prepare-commit-msg</code> hook that comes with Git comments |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 839 | out the <code>Conflicts:</code> part of a merge’s commit message.</p></div> |
| 840 | </div> |
| 841 | <div class="sect2"> |
| 842 | <h3 id="_commit_msg">commit-msg</h3> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 843 | <div class="paragraph"><p>This hook is invoked by <em>git commit</em>, and can be bypassed |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 844 | with <code>--no-verify</code> option. It takes a single parameter, the |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 845 | name of the file that holds the proposed commit log message. |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 846 | Exiting with non-zero status causes the <em>git commit</em> to |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 847 | abort.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 848 | <div class="paragraph"><p>The hook is allowed to edit the message file in place, and can |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 849 | be used to normalize the message into some project standard |
| 850 | format (if the project has one). It can also be used to refuse |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 851 | the commit after inspecting the message file.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 852 | <div class="paragraph"><p>The default <em>commit-msg</em> hook, when enabled, detects duplicate |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 853 | "Signed-off-by" lines, and aborts the commit if one is found.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 854 | </div> |
| 855 | <div class="sect2"> |
| 856 | <h3 id="_post_commit">post-commit</h3> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 857 | <div class="paragraph"><p>This hook is invoked by <em>git commit</em>. It takes no |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 858 | parameter, and is invoked after a commit is made.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 859 | <div class="paragraph"><p>This hook is meant primarily for notification, and cannot affect |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 860 | the outcome of <em>git commit</em>.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 861 | </div> |
| 862 | <div class="sect2"> |
| 863 | <h3 id="_pre_rebase">pre-rebase</h3> |
Junio C Hamano | 947ab82 | 2013-03-19 23:07:29 | [diff] [blame^] | 864 | <div class="paragraph"><p>This hook is called by <em>git rebase</em> and can be used to prevent a |
| 865 | branch from getting rebased. The hook may be called with one or |
| 866 | two parameters. The first parameter is the upstream from which |
| 867 | the series was forked. The second parameter is the branch being |
| 868 | rebased, and is not set when rebasing the current branch.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 869 | </div> |
| 870 | <div class="sect2"> |
| 871 | <h3 id="_post_checkout">post-checkout</h3> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 872 | <div class="paragraph"><p>This hook is invoked when a <em>git checkout</em> is run after having updated the |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 873 | worktree. The hook is given three parameters: the ref of the previous HEAD, |
| 874 | the ref of the new HEAD (which may or may not have changed), and a flag |
| 875 | indicating whether the checkout was a branch checkout (changing branches, |
| 876 | flag=1) or a file checkout (retrieving a file from the index, flag=0). |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 877 | This hook cannot affect the outcome of <em>git checkout</em>.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 878 | <div class="paragraph"><p>It is also run after <em>git clone</em>, unless the --no-checkout (-n) option is |
Junio C Hamano | 36a5672 | 2009-03-28 08:55:34 | [diff] [blame] | 879 | used. The first parameter given to the hook is the null-ref, the second the |
| 880 | ref of the new HEAD and the flag is always 1.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 881 | <div class="paragraph"><p>This hook can be used to perform repository validity checks, auto-display |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 882 | differences from the previous HEAD if different, or set working dir metadata |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 883 | properties.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 884 | </div> |
| 885 | <div class="sect2"> |
| 886 | <h3 id="_post_merge">post-merge</h3> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 887 | <div class="paragraph"><p>This hook is invoked by <em>git merge</em>, which happens when a <em>git pull</em> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 888 | is done on a local repository. The hook takes a single parameter, a status |
| 889 | flag specifying whether or not the merge being done was a squash merge. |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 890 | This hook cannot affect the outcome of <em>git merge</em> and is not executed, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 891 | if the merge failed due to conflicts.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 892 | <div class="paragraph"><p>This hook can be used in conjunction with a corresponding pre-commit hook to |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 893 | save and restore any form of metadata associated with the working tree |
| 894 | (eg: permissions/ownership, ACLS, etc). See contrib/hooks/setgitperms.perl |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 895 | for an example of how to do this.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 896 | </div> |
| 897 | <div class="sect2"> |
Junio C Hamano | 36d5229 | 2013-01-25 21:32:36 | [diff] [blame] | 898 | <h3 id="_pre_push">pre-push</h3> |
| 899 | <div class="paragraph"><p>This hook is called by <em>git push</em> and can be used to prevent a push from taking |
| 900 | place. The hook is called with two parameters which provide the name and |
| 901 | location of the destination remote, if a named remote is not being used both |
| 902 | values will be the same.</p></div> |
| 903 | <div class="paragraph"><p>Information about what is to be pushed is provided on the hook’s standard |
| 904 | input with lines of the form:</p></div> |
| 905 | <div class="literalblock"> |
| 906 | <div class="content"> |
| 907 | <pre><code><local ref> SP <local sha1> SP <remote ref> SP <remote sha1> LF</code></pre> |
| 908 | </div></div> |
| 909 | <div class="paragraph"><p>For instance, if the command <code>git push origin master:foreign</code> were run the |
| 910 | hook would receive a line like the following:</p></div> |
| 911 | <div class="literalblock"> |
| 912 | <div class="content"> |
| 913 | <pre><code>refs/heads/master 67890 refs/heads/foreign 12345</code></pre> |
| 914 | </div></div> |
| 915 | <div class="paragraph"><p>although the full, 40-character SHA1s would be supplied. If the foreign ref |
| 916 | does not yet exist the <code><remote SHA1></code> will be 40 <code>0</code>. If a ref is to be |
| 917 | deleted, the <code><local ref></code> will be supplied as <code>(delete)</code> and the <code><local |
| 918 | SHA1></code> will be 40 <code>0</code>. If the local commit was specified by something other |
| 919 | than a name which could be expanded (such as <code>HEAD~</code>, or a SHA1) it will be |
| 920 | supplied as it was originally given.</p></div> |
| 921 | <div class="paragraph"><p>If this hook exits with a non-zero status, <em>git push</em> will abort without |
| 922 | pushing anything. Information about why the push is rejected may be sent |
| 923 | to the user by writing to standard error.</p></div> |
| 924 | </div> |
| 925 | <div class="sect2"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 926 | <h3 id="pre-receive">pre-receive</h3> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 927 | <div class="paragraph"><p>This hook is invoked by <em>git-receive-pack</em> on the remote repository, |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 928 | which happens when a <em>git push</em> is done on a local repository. |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 929 | Just before starting to update refs on the remote repository, the |
| 930 | pre-receive hook is invoked. Its exit status determines the success |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 931 | or failure of the update.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 932 | <div class="paragraph"><p>This hook executes once for the receive operation. It takes no |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 933 | arguments, but for each ref to be updated it receives on standard |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 934 | input a line of the format:</p></div> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 935 | <div class="literalblock"> |
| 936 | <div class="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 937 | <pre><code><old-value> SP <new-value> SP <ref-name> LF</code></pre> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 938 | </div></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 939 | <div class="paragraph"><p>where <code><old-value></code> is the old object name stored in the ref, |
| 940 | <code><new-value></code> is the new object name to be stored in the ref and |
| 941 | <code><ref-name></code> is the full name of the ref. |
| 942 | When creating a new ref, <code><old-value></code> is 40 <code>0</code>.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 943 | <div class="paragraph"><p>If the hook exits with non-zero status, none of the refs will be |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 944 | updated. If the hook exits with zero, updating of individual refs can |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 945 | still be prevented by the <a href="#update"><em>update</em></a> hook.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 946 | <div class="paragraph"><p>Both standard output and standard error output are forwarded to |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 947 | <em>git send-pack</em> on the other end, so you can simply <code>echo</code> messages |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 948 | for the user.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 949 | </div> |
| 950 | <div class="sect2"> |
| 951 | <h3 id="update">update</h3> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 952 | <div class="paragraph"><p>This hook is invoked by <em>git-receive-pack</em> on the remote repository, |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 953 | which happens when a <em>git push</em> is done on a local repository. |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 954 | Just before updating the ref on the remote repository, the update hook |
| 955 | is invoked. Its exit status determines the success or failure of |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 956 | the ref update.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 957 | <div class="paragraph"><p>The hook executes once for each ref to be updated, and takes |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 958 | three parameters:</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 959 | <div class="ulist"><ul> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 960 | <li> |
| 961 | <p> |
| 962 | the name of the ref being updated, |
| 963 | </p> |
| 964 | </li> |
| 965 | <li> |
| 966 | <p> |
| 967 | the old object name stored in the ref, |
| 968 | </p> |
| 969 | </li> |
| 970 | <li> |
| 971 | <p> |
| 972 | and the new objectname to be stored in the ref. |
| 973 | </p> |
| 974 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 975 | </ul></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 976 | <div class="paragraph"><p>A zero exit from the update hook allows the ref to be updated. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 977 | Exiting with a non-zero status prevents <em>git-receive-pack</em> |
| 978 | from updating that ref.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 979 | <div class="paragraph"><p>This hook can be used to prevent <em>forced</em> update on certain refs by |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 980 | making sure that the object name is a commit object that is a |
| 981 | descendant of the commit object named by the old object name. |
Junio C Hamano | 3f680f3 | 2009-11-16 02:10:54 | [diff] [blame] | 982 | That is, to enforce a "fast-forward only" policy.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 983 | <div class="paragraph"><p>It could also be used to log the old..new status. However, it |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 984 | does not know the entire set of branches, so it would end up |
| 985 | firing one e-mail per ref when used naively, though. The |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 986 | <a href="#post-receive"><em>post-receive</em></a> hook is more suited to that.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 987 | <div class="paragraph"><p>Another use suggested on the mailing list is to use this hook to |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 988 | implement access control which is finer grained than the one |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 989 | based on filesystem group.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 990 | <div class="paragraph"><p>Both standard output and standard error output are forwarded to |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 991 | <em>git send-pack</em> on the other end, so you can simply <code>echo</code> messages |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 992 | for the user.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 993 | <div class="paragraph"><p>The default <em>update</em> hook, when enabled—and with |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 994 | <code>hooks.allowunannotated</code> config option unset or set to false—prevents |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 995 | unannotated tags to be pushed.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 996 | </div> |
| 997 | <div class="sect2"> |
| 998 | <h3 id="post-receive">post-receive</h3> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 999 | <div class="paragraph"><p>This hook is invoked by <em>git-receive-pack</em> on the remote repository, |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1000 | which happens when a <em>git push</em> is done on a local repository. |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 1001 | It executes on the remote repository once after all the refs have |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1002 | been updated.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1003 | <div class="paragraph"><p>This hook executes once for the receive operation. It takes no |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 1004 | arguments, but gets the same information as the |
| 1005 | <a href="#pre-receive"><em>pre-receive</em></a> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1006 | hook does on its standard input.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1007 | <div class="paragraph"><p>This hook does not affect the outcome of <em>git-receive-pack</em>, as it |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1008 | is called after the real work is done.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1009 | <div class="paragraph"><p>This supersedes the <a href="#post-update"><em>post-update</em></a> hook in that it gets |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 1010 | both old and new values of all the refs in addition to their |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1011 | names.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1012 | <div class="paragraph"><p>Both standard output and standard error output are forwarded to |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1013 | <em>git send-pack</em> on the other end, so you can simply <code>echo</code> messages |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1014 | for the user.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1015 | <div class="paragraph"><p>The default <em>post-receive</em> hook is empty, but there is |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1016 | a sample script <code>post-receive-email</code> provided in the <code>contrib/hooks</code> |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 1017 | directory in Git distribution, which implements sending commit |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1018 | emails.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1019 | </div> |
| 1020 | <div class="sect2"> |
| 1021 | <h3 id="post-update">post-update</h3> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1022 | <div class="paragraph"><p>This hook is invoked by <em>git-receive-pack</em> on the remote repository, |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1023 | which happens when a <em>git push</em> is done on a local repository. |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 1024 | It executes on the remote repository once after all the refs have |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1025 | been updated.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1026 | <div class="paragraph"><p>It takes a variable number of parameters, each of which is the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1027 | name of ref that was actually updated.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1028 | <div class="paragraph"><p>This hook is meant primarily for notification, and cannot affect |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1029 | the outcome of <em>git-receive-pack</em>.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1030 | <div class="paragraph"><p>The <em>post-update</em> hook can tell what are the heads that were pushed, |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 1031 | but it does not know what their original and updated values are, |
| 1032 | so it is a poor place to do log old..new. The |
| 1033 | <a href="#post-receive"><em>post-receive</em></a> hook does get both original and |
| 1034 | updated values of the refs. You might consider it instead if you need |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1035 | them.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1036 | <div class="paragraph"><p>When enabled, the default <em>post-update</em> hook runs |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1037 | <em>git update-server-info</em> to keep the information used by dumb |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 1038 | transports (e.g., HTTP) up-to-date. If you are publishing |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 1039 | a Git repository that is accessible via HTTP, you should |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1040 | probably enable this hook.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1041 | <div class="paragraph"><p>Both standard output and standard error output are forwarded to |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1042 | <em>git send-pack</em> on the other end, so you can simply <code>echo</code> messages |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1043 | for the user.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1044 | </div> |
| 1045 | <div class="sect2"> |
| 1046 | <h3 id="_pre_auto_gc">pre-auto-gc</h3> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1047 | <div class="paragraph"><p>This hook is invoked by <em>git gc --auto</em>. It takes no parameter, and |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1048 | exiting with non-zero status from this script causes the <em>git gc --auto</em> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1049 | to abort.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1050 | </div> |
| 1051 | <div class="sect2"> |
| 1052 | <h3 id="_post_rewrite">post-rewrite</h3> |
| 1053 | <div class="paragraph"><p>This hook is invoked by commands that rewrite commits (<code>git commit |
| 1054 | --amend</code>, <em>git-rebase</em>; currently <em>git-filter-branch</em> does <em>not</em> call |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 1055 | it!). Its first argument denotes the command it was invoked by: |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1056 | currently one of <code>amend</code> or <code>rebase</code>. Further command-dependent |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 1057 | arguments may be passed in the future.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1058 | <div class="paragraph"><p>The hook receives a list of the rewritten commits on stdin, in the |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 1059 | format</p></div> |
| 1060 | <div class="literalblock"> |
| 1061 | <div class="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1062 | <pre><code><old-sha1> SP <new-sha1> [ SP <extra-info> ] LF</code></pre> |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 1063 | </div></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1064 | <div class="paragraph"><p>The <em>extra-info</em> is again command-dependent. If it is empty, the |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 1065 | preceding SP is also omitted. Currently, no commands pass any |
| 1066 | <em>extra-info</em>.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1067 | <div class="paragraph"><p>The hook always runs after the automatic note copying (see |
Junio C Hamano | 6806162 | 2013-03-01 22:13:37 | [diff] [blame] | 1068 | "notes.rewrite.<command>" in <a href="git-config.txt.html">git-config.txt(1)</a>) has happened, and |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 1069 | thus has access to these notes.</p></div> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1070 | <div class="paragraph"><p>The following command-specific comments apply:</p></div> |
| 1071 | <div class="dlist"><dl> |
| 1072 | <dt class="hdlist1"> |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 1073 | rebase |
| 1074 | </dt> |
| 1075 | <dd> |
| 1076 | <p> |
| 1077 | For the <em>squash</em> and <em>fixup</em> operation, all commits that were |
| 1078 | squashed are listed as being rewritten to the squashed commit. |
| 1079 | This means that there will be several lines sharing the same |
| 1080 | <em>new-sha1</em>. |
| 1081 | </p> |
Junio C Hamano | 8143563 | 2011-01-12 09:08:48 | [diff] [blame] | 1082 | <div class="paragraph"><p>The commits are guaranteed to be listed in the order that they were |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 1083 | processed by rebase.</p></div> |
| 1084 | </dd> |
| 1085 | </dl></div> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 1086 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1087 | </div> |
| 1088 | </div> |
| 1089 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1090 | <h2 id="_git">GIT</h2> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 1091 | <div class="sectionbody"> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1092 | <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 1093 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 1094 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1095 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 1096 | <div id="footnotes"><hr /></div> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 1097 | <div id="footer"> |
| 1098 | <div id="footer-text"> |
Junio C Hamano | 947ab82 | 2013-03-19 23:07:29 | [diff] [blame^] | 1099 | Last updated 2013-03-19 16:06:22 PDT |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 1100 | </div> |
| 1101 | </div> |
| 1102 | </body> |
| 1103 | </html> |