| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [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> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 8.4.5" /> |
| 7 | <title>git-show(1)</title> |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 8 | <style type="text/css"> |
| 9 | /* Debug borders */ |
| 10 | p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { |
| 11 | /* |
| 12 | border: 1px solid red; |
| 13 | */ |
| 14 | } |
| 15 | |
| 16 | body { |
| 17 | margin: 1em 5% 1em 5%; |
| 18 | } |
| 19 | |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 20 | a { |
| 21 | color: blue; |
| 22 | text-decoration: underline; |
| 23 | } |
| 24 | a:visited { |
| 25 | color: fuchsia; |
| 26 | } |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 27 | |
| 28 | em { |
| 29 | font-style: italic; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 30 | color: navy; |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | strong { |
| 34 | font-weight: bold; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 35 | color: #083194; |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | tt { |
| 39 | color: navy; |
| 40 | } |
| 41 | |
| 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; |
| 48 | } |
| 49 | |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 50 | h1, h2, h3 { |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 51 | border-bottom: 2px solid silver; |
| 52 | } |
| 53 | h2 { |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 54 | padding-top: 0.5em; |
| 55 | } |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 56 | h3 { |
| 57 | float: left; |
| 58 | } |
| 59 | h3 + * { |
| 60 | clear: left; |
| 61 | } |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 62 | |
| 63 | div.sectionbody { |
| 64 | font-family: serif; |
| 65 | margin-left: 0; |
| 66 | } |
| 67 | |
| 68 | hr { |
| 69 | border: 1px solid silver; |
| 70 | } |
| 71 | |
| 72 | p { |
| 73 | margin-top: 0.5em; |
| 74 | margin-bottom: 0.5em; |
| 75 | } |
| 76 | |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 77 | ul, ol, li > p { |
| 78 | margin-top: 0; |
| 79 | } |
| 80 | |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 81 | pre { |
| 82 | padding: 0; |
| 83 | margin: 0; |
| 84 | } |
| 85 | |
| 86 | span#author { |
| 87 | color: #527bbd; |
| 88 | font-family: sans-serif; |
| 89 | font-weight: bold; |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 90 | font-size: 1.1em; |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 91 | } |
| 92 | span#email { |
| 93 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 94 | span#revnumber, span#revdate, span#revremark { |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 95 | font-family: sans-serif; |
| 96 | } |
| 97 | |
| 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; |
| 104 | } |
| 105 | div#footer-text { |
| 106 | float: left; |
| 107 | padding-bottom: 0.5em; |
| 108 | } |
| 109 | div#footer-badges { |
| 110 | float: right; |
| 111 | padding-bottom: 0.5em; |
| 112 | } |
| 113 | |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 114 | div#preamble { |
| 115 | margin-top: 1.5em; |
| 116 | margin-bottom: 1.5em; |
| 117 | } |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 118 | div.tableblock, div.imageblock, div.exampleblock, div.verseblock, |
| 119 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 120 | div.admonitionblock { |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 121 | margin-top: 1.5em; |
| 122 | margin-bottom: 1.5em; |
| 123 | } |
| 124 | div.admonitionblock { |
| 125 | margin-top: 2.5em; |
| 126 | margin-bottom: 2.5em; |
| 127 | } |
| 128 | |
| 129 | div.content { /* Block element content. */ |
| 130 | padding: 0; |
| 131 | } |
| 132 | |
| 133 | /* Block element titles. */ |
| 134 | div.title, caption.title { |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 135 | color: #527bbd; |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 136 | font-family: sans-serif; |
| 137 | font-weight: bold; |
| 138 | text-align: left; |
| 139 | margin-top: 1.0em; |
| 140 | margin-bottom: 0.5em; |
| 141 | } |
| 142 | div.title + * { |
| 143 | margin-top: 0; |
| 144 | } |
| 145 | |
| 146 | td div.title:first-child { |
| 147 | margin-top: 0.0em; |
| 148 | } |
| 149 | div.content div.title:first-child { |
| 150 | margin-top: 0.0em; |
| 151 | } |
| 152 | div.content + div.title { |
| 153 | margin-top: 0.0em; |
| 154 | } |
| 155 | |
| 156 | div.sidebarblock > div.content { |
| 157 | background: #ffffee; |
| 158 | border: 1px solid silver; |
| 159 | padding: 0.5em; |
| 160 | } |
| 161 | |
| 162 | div.listingblock > div.content { |
| 163 | border: 1px solid silver; |
| 164 | background: #f4f4f4; |
| 165 | padding: 0.5em; |
| 166 | } |
| 167 | |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 168 | div.quoteblock { |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 169 | padding-left: 2.0em; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 170 | margin-right: 10%; |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 171 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 172 | div.quoteblock > div.attribution { |
| 173 | padding-top: 0.5em; |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 174 | text-align: right; |
| 175 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 176 | |
| 177 | div.verseblock { |
| 178 | padding-left: 2.0em; |
| 179 | margin-right: 10%; |
| 180 | } |
| 181 | div.verseblock > div.content { |
| 182 | white-space: pre; |
| 183 | } |
| 184 | div.verseblock > div.attribution { |
| 185 | padding-top: 0.75em; |
| 186 | text-align: left; |
| 187 | } |
| 188 | /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 189 | div.verseblock + div.attribution { |
| 190 | text-align: left; |
| 191 | } |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 192 | |
| 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; |
| 200 | } |
| 201 | div.admonitionblock td.content { |
| 202 | padding-left: 0.5em; |
| 203 | border-left: 2px solid silver; |
| 204 | } |
| 205 | |
| 206 | div.exampleblock > div.content { |
| 207 | border-left: 2px solid silver; |
| 208 | padding: 0.5em; |
| 209 | } |
| 210 | |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 211 | div.imageblock div.content { padding-left: 0; } |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 212 | span.image img { border-style: none; } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 213 | a.image:visited { color: white; } |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 214 | |
| 215 | dl { |
| 216 | margin-top: 0.8em; |
| 217 | margin-bottom: 0.8em; |
| 218 | } |
| 219 | dt { |
| 220 | margin-top: 0.5em; |
| 221 | margin-bottom: 0; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 222 | font-style: normal; |
| 223 | color: navy; |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 224 | } |
| 225 | dd > *:first-child { |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 226 | margin-top: 0.1em; |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | ul, ol { |
| 230 | list-style-position: outside; |
| 231 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 232 | ol.arabic { |
| 233 | list-style-type: decimal; |
| 234 | } |
| 235 | ol.loweralpha { |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 236 | list-style-type: lower-alpha; |
| 237 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 238 | ol.upperalpha { |
| 239 | list-style-type: upper-alpha; |
| 240 | } |
| 241 | ol.lowerroman { |
| 242 | list-style-type: lower-roman; |
| 243 | } |
| 244 | ol.upperroman { |
| 245 | list-style-type: upper-roman; |
| 246 | } |
| 247 | |
| 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; |
| 253 | } |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 254 | |
| 255 | div.tableblock > table { |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 256 | border: 3px solid #527bbd; |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 257 | } |
| 258 | thead { |
| 259 | font-family: sans-serif; |
| 260 | font-weight: bold; |
| 261 | } |
| 262 | tfoot { |
| 263 | font-weight: bold; |
| 264 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 265 | td > div.verse { |
| 266 | white-space: pre; |
| 267 | } |
| 268 | p.table { |
| 269 | margin-top: 0; |
| 270 | } |
| 271 | /* Because the table frame attribute is overriden by CSS in most browsers. */ |
| 272 | div.tableblock > table[frame="void"] { |
| 273 | border-style: none; |
| 274 | } |
| 275 | div.tableblock > table[frame="hsides"] { |
| 276 | border-left-style: none; |
| 277 | border-right-style: none; |
| 278 | } |
| 279 | div.tableblock > table[frame="vsides"] { |
| 280 | border-top-style: none; |
| 281 | border-bottom-style: none; |
| 282 | } |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 283 | |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 284 | |
| 285 | div.hdlist { |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 286 | margin-top: 0.8em; |
| 287 | margin-bottom: 0.8em; |
| 288 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 289 | div.hdlist tr { |
| 290 | padding-bottom: 15px; |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 291 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 292 | dt.hdlist1.strong, td.hdlist1.strong { |
| 293 | font-weight: bold; |
| 294 | } |
| 295 | td.hdlist1 { |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 296 | vertical-align: top; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 297 | font-style: normal; |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 298 | padding-right: 0.8em; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 299 | color: navy; |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 300 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 301 | td.hdlist2 { |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 302 | vertical-align: top; |
| 303 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 304 | div.hdlist.compact tr { |
| 305 | margin: 0; |
| 306 | padding-bottom: 0; |
| 307 | } |
| 308 | |
| 309 | .comment { |
| 310 | background: yellow; |
| 311 | } |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 312 | |
| 313 | @media print { |
| 314 | div#footer-badges { display: none; } |
| 315 | } |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 316 | |
| 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; |
| 324 | } |
| 325 | |
| 326 | div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
| 327 | margin-top: 0; |
| 328 | margin-bottom: 0; |
| 329 | } |
| 330 | div.toclevel2 { |
| 331 | margin-left: 2em; |
| 332 | font-size: 0.9em; |
| 333 | } |
| 334 | div.toclevel3 { |
| 335 | margin-left: 4em; |
| 336 | font-size: 0.9em; |
| 337 | } |
| 338 | div.toclevel4 { |
| 339 | margin-left: 6em; |
| 340 | font-size: 0.9em; |
| 341 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 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; |
| 348 | } |
| 349 | h2 { |
| 350 | border-style: none; |
| 351 | } |
| 352 | div.sectionbody { |
| 353 | margin-left: 5%; |
| 354 | } |
| 355 | |
| 356 | @media print { |
| 357 | div#toc { display: none; } |
| 358 | } |
| 359 | |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 360 | /* Workarounds for IE6's broken and incomplete CSS2. */ |
| 361 | |
| 362 | div.sidebar-content { |
| 363 | background: #ffffee; |
| 364 | border: 1px solid silver; |
| 365 | padding: 0.5em; |
| 366 | } |
| 367 | div.sidebar-title, div.image-title { |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 368 | color: #527bbd; |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 369 | font-family: sans-serif; |
| 370 | font-weight: bold; |
| 371 | margin-top: 0.0em; |
| 372 | margin-bottom: 0.5em; |
| 373 | } |
| 374 | |
| 375 | div.listingblock div.content { |
| 376 | border: 1px solid silver; |
| 377 | background: #f4f4f4; |
| 378 | padding: 0.5em; |
| 379 | } |
| 380 | |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 381 | div.quoteblock-attribution { |
| 382 | padding-top: 0.5em; |
| 383 | text-align: right; |
| 384 | } |
| 385 | |
| 386 | div.verseblock-content { |
| 387 | white-space: pre; |
| 388 | } |
| 389 | div.verseblock-attribution { |
| 390 | padding-top: 0.75em; |
| 391 | text-align: left; |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 392 | } |
| 393 | |
| 394 | div.exampleblock-content { |
| 395 | border-left: 2px solid silver; |
| 396 | padding-left: 0.5em; |
| 397 | } |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 398 | |
| 399 | /* IE6 sets dynamically generated links as visited. */ |
| 400 | div#toc a:visited { color: blue; } |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 401 | </style> |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 402 | </head> |
| 403 | <body> |
| 404 | <div id="header"> |
| 405 | <h1> |
| 406 | git-show(1) Manual Page |
| 407 | </h1> |
| 408 | <h2>NAME</h2> |
| 409 | <div class="sectionbody"> |
| 410 | <p>git-show - |
| Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 411 | Show various types of objects |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 412 | </p> |
| 413 | </div> |
| 414 | </div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 415 | <h2 id="_synopsis">SYNOPSIS</h2> |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 416 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 417 | <div class="paragraph"><p><em>git show</em> [options] <object>…</p></div> |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 418 | </div> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 419 | <h2 id="_description">DESCRIPTION</h2> |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 420 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 421 | <div class="paragraph"><p>Shows one or more objects (blobs, trees, tags and commits).</p></div> |
| 422 | <div class="paragraph"><p>For commits it shows the log message and textual diff. It also |
| Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 423 | presents the merge commit in a special format as produced by |
| Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 424 | <em>git diff-tree --cc</em>.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 425 | <div class="paragraph"><p>For tags, it shows the tag message and the referenced objects.</p></div> |
| 426 | <div class="paragraph"><p>For trees, it shows the names (equivalent to <em>git ls-tree</em> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 427 | with --name-only).</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 428 | <div class="paragraph"><p>For plain blobs, it shows the plain contents.</p></div> |
| 429 | <div class="paragraph"><p>The command takes options applicable to the <em>git diff-tree</em> command to |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 430 | control how the changes the commit introduces are shown.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 431 | <div class="paragraph"><p>This manual page describes only the most frequently used options.</p></div> |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 432 | </div> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 433 | <h2 id="_options">OPTIONS</h2> |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 434 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 435 | <div class="dlist"><dl> |
| 436 | <dt class="hdlist1"> |
| Junio C Hamano | 9e39507 | 2008-07-31 22:11:21 | [diff] [blame] | 437 | <object>… |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 438 | </dt> |
| 439 | <dd> |
| 440 | <p> |
| Junio C Hamano | 9e39507 | 2008-07-31 22:11:21 | [diff] [blame] | 441 | The names of objects to show. |
| Junio C Hamano | 2d47c62 | 2007-01-18 06:24:10 | [diff] [blame] | 442 | For a more complete list of ways to spell object names, see |
| Junio C Hamano | c27b733 | 2010-10-14 04:37:28 | [diff] [blame] | 443 | "SPECIFYING REVISIONS" section in <a href="gitrevisions.html">gitrevisions(7)</a>. |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 444 | </p> |
| 445 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 446 | <dt class="hdlist1"> |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 447 | --pretty[=<format>] |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 448 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 449 | <dt class="hdlist1"> |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 450 | --format=<format> |
| Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 451 | </dt> |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 452 | <dd> |
| 453 | <p> |
| Junio C Hamano | a3770f9 | 2007-07-25 08:53:33 | [diff] [blame] | 454 | Pretty-print the contents of the commit logs in a given format, |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 455 | where <em><format></em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>, |
| Junio C Hamano | e32ec8b | 2010-06-02 23:32:31 | [diff] [blame] | 456 | <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:<string></em>. See |
| 457 | the "PRETTY FORMATS" section for some additional details for each |
| 458 | format. When omitted, the format defaults to <em>medium</em>. |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 459 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 460 | <div class="paragraph"><p>Note: you can specify the default pretty format in the repository |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 461 | configuration (see <a href="git-config.html">git-config(1)</a>).</p></div> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 462 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 463 | <dt class="hdlist1"> |
| Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 464 | --abbrev-commit |
| 465 | </dt> |
| 466 | <dd> |
| 467 | <p> |
| 468 | Instead of showing the full 40-byte hexadecimal commit object |
| Junio C Hamano | 6efe302 | 2009-01-13 16:47:56 | [diff] [blame] | 469 | name, show only a partial prefix. Non default number of |
| Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 470 | digits can be specified with "--abbrev=<n>" (which also modifies |
| 471 | diff output, if it is displayed). |
| 472 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 473 | <div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 474 | people using 80-column terminals.</p></div> |
| Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 475 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 476 | <dt class="hdlist1"> |
| Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 477 | --oneline |
| 478 | </dt> |
| 479 | <dd> |
| 480 | <p> |
| 481 | This is a shorthand for "--pretty=oneline --abbrev-commit" |
| 482 | used together. |
| 483 | </p> |
| 484 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 485 | <dt class="hdlist1"> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 486 | --encoding[=<encoding>] |
| 487 | </dt> |
| 488 | <dd> |
| 489 | <p> |
| 490 | The commit objects record the encoding used for the log message |
| 491 | in their encoding header; this option can be used to tell the |
| 492 | command to re-code the commit log message in the encoding |
| 493 | preferred by the user. For non plumbing commands this |
| 494 | defaults to UTF-8. |
| 495 | </p> |
| 496 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 497 | <dt class="hdlist1"> |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame^] | 498 | --notes[=<ref>] |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 499 | </dt> |
| 500 | <dd> |
| 501 | <p> |
| 502 | Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the |
| 503 | commit, when showing the commit log message. This is the default |
| 504 | for <tt>git log</tt>, <tt>git show</tt> and <tt>git whatchanged</tt> commands when |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame^] | 505 | there is no <tt>--pretty</tt>, <tt>--format</tt> nor <tt>--oneline</tt> option given |
| 506 | on the command line. |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 507 | </p> |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame^] | 508 | <div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the |
| 509 | <em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding |
| 510 | environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div> |
| 511 | <div class="paragraph"><p>With an optional <em><ref></em> argument, show this notes ref instead of the |
| 512 | default notes ref(s). The ref is taken to be in <tt>refs/notes/</tt> if it |
| 513 | is not qualified.</p></div> |
| 514 | <div class="paragraph"><p>Multiple --notes options can be combined to control which notes are |
| 515 | being displayed. Examples: "--notes=foo" will show only notes from |
| 516 | "refs/notes/foo"; "--notes=foo --notes" will show both notes from |
| 517 | "refs/notes/foo" and from the default notes ref(s).</p></div> |
| Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 518 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 519 | <dt class="hdlist1"> |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame^] | 520 | --no-notes |
| 521 | </dt> |
| 522 | <dd> |
| 523 | <p> |
| 524 | Do not show notes. This negates the above <tt>--notes</tt> option, by |
| 525 | resetting the list of notes refs from which notes are shown. |
| 526 | Options are parsed in the order given on the command line, so e.g. |
| 527 | "--notes --notes=foo --no-notes --notes=bar" will only show notes |
| 528 | from "refs/notes/bar". |
| 529 | </p> |
| 530 | </dd> |
| 531 | <dt class="hdlist1"> |
| 532 | --show-notes[=<ref>] |
| 533 | </dt> |
| 534 | <dt class="hdlist1"> |
| Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 535 | --[no-]standard-notes |
| 536 | </dt> |
| 537 | <dd> |
| 538 | <p> |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame^] | 539 | These options are deprecated. Use the above --notes/--no-notes |
| 540 | options instead. |
| Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 541 | </p> |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 542 | </dd> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 543 | </dl></div> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 544 | </div> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 545 | <h2 id="_pretty_formats">PRETTY FORMATS</h2> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 546 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 547 | <div class="paragraph"><p>If the commit is a merge, and if the pretty-format |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 548 | is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is |
| 549 | inserted before the <em>Author:</em> line. This line begins with |
| 550 | "Merge: " and the sha1s of ancestral commits are printed, |
| 551 | separated by spaces. Note that the listed commits may not |
| 552 | necessarily be the list of the <strong>direct</strong> parent commits if you |
| 553 | have limited your view of history: for example, if you are |
| 554 | only interested in changes related to a certain directory or |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 555 | file.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 556 | <div class="paragraph"><p>There are several built-in formats, and you can define |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 557 | additional formats by setting a pretty.<name> |
| 558 | config option to either another format name, or a |
| 559 | <em>format:</em> string, as described below (see |
| 560 | <a href="git-config.html">git-config(1)</a>). Here are the details of the |
| 561 | built-in formats:</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 562 | <div class="ulist"><ul> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 563 | <li> |
| 564 | <p> |
| 565 | <em>oneline</em> |
| 566 | </p> |
| 567 | <div class="literalblock"> |
| 568 | <div class="content"> |
| 569 | <pre><tt><sha1> <title line></tt></pre> |
| 570 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 571 | <div class="paragraph"><p>This is designed to be as compact as possible.</p></div> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 572 | </li> |
| 573 | <li> |
| 574 | <p> |
| 575 | <em>short</em> |
| 576 | </p> |
| 577 | <div class="literalblock"> |
| 578 | <div class="content"> |
| 579 | <pre><tt>commit <sha1> |
| 580 | Author: <author></tt></pre> |
| 581 | </div></div> |
| 582 | <div class="literalblock"> |
| 583 | <div class="content"> |
| 584 | <pre><tt><title line></tt></pre> |
| 585 | </div></div> |
| 586 | </li> |
| 587 | <li> |
| 588 | <p> |
| 589 | <em>medium</em> |
| 590 | </p> |
| 591 | <div class="literalblock"> |
| 592 | <div class="content"> |
| 593 | <pre><tt>commit <sha1> |
| 594 | Author: <author> |
| Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 595 | Date: <author date></tt></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 596 | </div></div> |
| 597 | <div class="literalblock"> |
| 598 | <div class="content"> |
| 599 | <pre><tt><title line></tt></pre> |
| 600 | </div></div> |
| 601 | <div class="literalblock"> |
| 602 | <div class="content"> |
| 603 | <pre><tt><full commit message></tt></pre> |
| 604 | </div></div> |
| 605 | </li> |
| 606 | <li> |
| 607 | <p> |
| 608 | <em>full</em> |
| 609 | </p> |
| 610 | <div class="literalblock"> |
| 611 | <div class="content"> |
| 612 | <pre><tt>commit <sha1> |
| 613 | Author: <author> |
| 614 | Commit: <committer></tt></pre> |
| 615 | </div></div> |
| 616 | <div class="literalblock"> |
| 617 | <div class="content"> |
| 618 | <pre><tt><title line></tt></pre> |
| 619 | </div></div> |
| 620 | <div class="literalblock"> |
| 621 | <div class="content"> |
| 622 | <pre><tt><full commit message></tt></pre> |
| 623 | </div></div> |
| 624 | </li> |
| 625 | <li> |
| 626 | <p> |
| 627 | <em>fuller</em> |
| 628 | </p> |
| 629 | <div class="literalblock"> |
| 630 | <div class="content"> |
| 631 | <pre><tt>commit <sha1> |
| Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 632 | Author: <author> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 633 | AuthorDate: <author date> |
| Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 634 | Commit: <committer> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 635 | CommitDate: <committer date></tt></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 636 | </div></div> |
| 637 | <div class="literalblock"> |
| 638 | <div class="content"> |
| 639 | <pre><tt><title line></tt></pre> |
| 640 | </div></div> |
| 641 | <div class="literalblock"> |
| 642 | <div class="content"> |
| 643 | <pre><tt><full commit message></tt></pre> |
| 644 | </div></div> |
| 645 | </li> |
| 646 | <li> |
| 647 | <p> |
| 648 | <em>email</em> |
| 649 | </p> |
| 650 | <div class="literalblock"> |
| 651 | <div class="content"> |
| 652 | <pre><tt>From <sha1> <date> |
| 653 | From: <author> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 654 | Date: <author date> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 655 | Subject: [PATCH] <title line></tt></pre> |
| 656 | </div></div> |
| 657 | <div class="literalblock"> |
| 658 | <div class="content"> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 659 | <pre><tt><full commit message></tt></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 660 | </div></div> |
| 661 | </li> |
| 662 | <li> |
| 663 | <p> |
| 664 | <em>raw</em> |
| 665 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 666 | <div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 667 | stored in the commit object. Notably, the SHA1s are |
| 668 | displayed in full, regardless of whether --abbrev or |
| 669 | --no-abbrev are used, and <em>parents</em> information show the |
| 670 | true parent commits, without taking grafts nor history |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 671 | simplification into account.</p></div> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 672 | </li> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 673 | <li> |
| 674 | <p> |
| Junio C Hamano | e32ec8b | 2010-06-02 23:32:31 | [diff] [blame] | 675 | <em>format:<string></em> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 676 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 677 | <div class="paragraph"><p>The <em>format:<string></em> format allows you to specify which information |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 678 | you want to show. It works a little bit like printf format, |
| 679 | with the notable exception that you get a newline with <em>%n</em> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 680 | instead of <em>\n</em>.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 681 | <div class="paragraph"><p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was >>%s<<%n"</em> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 682 | would show something like this:</p></div> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 683 | <div class="listingblock"> |
| 684 | <div class="content"> |
| 685 | <pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 686 | The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<</tt></pre> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 687 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 688 | <div class="paragraph"><p>The placeholders are:</p></div> |
| 689 | <div class="ulist"><ul> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 690 | <li> |
| 691 | <p> |
| 692 | <em>%H</em>: commit hash |
| 693 | </p> |
| 694 | </li> |
| 695 | <li> |
| 696 | <p> |
| 697 | <em>%h</em>: abbreviated commit hash |
| 698 | </p> |
| 699 | </li> |
| 700 | <li> |
| 701 | <p> |
| 702 | <em>%T</em>: tree hash |
| 703 | </p> |
| 704 | </li> |
| 705 | <li> |
| 706 | <p> |
| 707 | <em>%t</em>: abbreviated tree hash |
| 708 | </p> |
| 709 | </li> |
| 710 | <li> |
| 711 | <p> |
| 712 | <em>%P</em>: parent hashes |
| 713 | </p> |
| 714 | </li> |
| 715 | <li> |
| 716 | <p> |
| 717 | <em>%p</em>: abbreviated parent hashes |
| 718 | </p> |
| 719 | </li> |
| 720 | <li> |
| 721 | <p> |
| 722 | <em>%an</em>: author name |
| 723 | </p> |
| 724 | </li> |
| 725 | <li> |
| 726 | <p> |
| Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 727 | <em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| Junio C Hamano | f5a9362 | 2008-07-16 03:23:57 | [diff] [blame] | 728 | </p> |
| 729 | </li> |
| 730 | <li> |
| 731 | <p> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 732 | <em>%ae</em>: author email |
| 733 | </p> |
| 734 | </li> |
| 735 | <li> |
| 736 | <p> |
| Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 737 | <em>%aE</em>: author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 738 | </p> |
| 739 | </li> |
| 740 | <li> |
| 741 | <p> |
| Junio C Hamano | a387df3 | 2008-08-29 08:56:58 | [diff] [blame] | 742 | <em>%ad</em>: author date (format respects --date= option) |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 743 | </p> |
| 744 | </li> |
| 745 | <li> |
| 746 | <p> |
| 747 | <em>%aD</em>: author date, RFC2822 style |
| 748 | </p> |
| 749 | </li> |
| 750 | <li> |
| 751 | <p> |
| 752 | <em>%ar</em>: author date, relative |
| 753 | </p> |
| 754 | </li> |
| 755 | <li> |
| 756 | <p> |
| 757 | <em>%at</em>: author date, UNIX timestamp |
| 758 | </p> |
| 759 | </li> |
| 760 | <li> |
| 761 | <p> |
| Junio C Hamano | 02f130b | 2007-07-14 08:26:56 | [diff] [blame] | 762 | <em>%ai</em>: author date, ISO 8601 format |
| 763 | </p> |
| 764 | </li> |
| 765 | <li> |
| 766 | <p> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 767 | <em>%cn</em>: committer name |
| 768 | </p> |
| 769 | </li> |
| 770 | <li> |
| 771 | <p> |
| Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 772 | <em>%cN</em>: committer name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| Junio C Hamano | f5a9362 | 2008-07-16 03:23:57 | [diff] [blame] | 773 | </p> |
| 774 | </li> |
| 775 | <li> |
| 776 | <p> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 777 | <em>%ce</em>: committer email |
| 778 | </p> |
| 779 | </li> |
| 780 | <li> |
| 781 | <p> |
| Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 782 | <em>%cE</em>: committer email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 783 | </p> |
| 784 | </li> |
| 785 | <li> |
| 786 | <p> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 787 | <em>%cd</em>: committer date |
| 788 | </p> |
| 789 | </li> |
| 790 | <li> |
| 791 | <p> |
| 792 | <em>%cD</em>: committer date, RFC2822 style |
| 793 | </p> |
| 794 | </li> |
| 795 | <li> |
| 796 | <p> |
| 797 | <em>%cr</em>: committer date, relative |
| 798 | </p> |
| 799 | </li> |
| 800 | <li> |
| 801 | <p> |
| 802 | <em>%ct</em>: committer date, UNIX timestamp |
| 803 | </p> |
| 804 | </li> |
| 805 | <li> |
| 806 | <p> |
| Junio C Hamano | 02f130b | 2007-07-14 08:26:56 | [diff] [blame] | 807 | <em>%ci</em>: committer date, ISO 8601 format |
| 808 | </p> |
| 809 | </li> |
| 810 | <li> |
| 811 | <p> |
| Junio C Hamano | 5e4d8de | 2008-09-19 06:27:02 | [diff] [blame] | 812 | <em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a> |
| 813 | </p> |
| 814 | </li> |
| 815 | <li> |
| 816 | <p> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 817 | <em>%e</em>: encoding |
| 818 | </p> |
| 819 | </li> |
| 820 | <li> |
| 821 | <p> |
| 822 | <em>%s</em>: subject |
| 823 | </p> |
| 824 | </li> |
| 825 | <li> |
| 826 | <p> |
| Junio C Hamano | 5f9a6f0 | 2009-04-06 08:26:56 | [diff] [blame] | 827 | <em>%f</em>: sanitized subject line, suitable for a filename |
| 828 | </p> |
| 829 | </li> |
| 830 | <li> |
| 831 | <p> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 832 | <em>%b</em>: body |
| 833 | </p> |
| 834 | </li> |
| 835 | <li> |
| 836 | <p> |
| Junio C Hamano | cb39aea | 2010-05-09 07:24:48 | [diff] [blame] | 837 | <em>%B</em>: raw body (unwrapped subject and body) |
| 838 | </p> |
| 839 | </li> |
| 840 | <li> |
| 841 | <p> |
| Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 842 | <em>%N</em>: commit notes |
| 843 | </p> |
| 844 | </li> |
| 845 | <li> |
| 846 | <p> |
| Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 847 | <em>%gD</em>: reflog selector, e.g., <tt>refs/stash@{1}</tt> |
| 848 | </p> |
| 849 | </li> |
| 850 | <li> |
| 851 | <p> |
| 852 | <em>%gd</em>: shortened reflog selector, e.g., <tt>stash@{1}</tt> |
| 853 | </p> |
| 854 | </li> |
| 855 | <li> |
| 856 | <p> |
| 857 | <em>%gs</em>: reflog subject |
| 858 | </p> |
| 859 | </li> |
| 860 | <li> |
| 861 | <p> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 862 | <em>%Cred</em>: switch color to red |
| 863 | </p> |
| 864 | </li> |
| 865 | <li> |
| 866 | <p> |
| 867 | <em>%Cgreen</em>: switch color to green |
| 868 | </p> |
| 869 | </li> |
| 870 | <li> |
| 871 | <p> |
| 872 | <em>%Cblue</em>: switch color to blue |
| 873 | </p> |
| 874 | </li> |
| 875 | <li> |
| 876 | <p> |
| 877 | <em>%Creset</em>: reset color |
| 878 | </p> |
| 879 | </li> |
| 880 | <li> |
| 881 | <p> |
| Junio C Hamano | cc0cb31 | 2009-01-22 03:38:50 | [diff] [blame] | 882 | <em>%C(…)</em>: color specification, as described in color.branch.* config option |
| 883 | </p> |
| 884 | </li> |
| 885 | <li> |
| 886 | <p> |
| Junio C Hamano | d9e0e5d | 2007-04-14 16:22:04 | [diff] [blame] | 887 | <em>%m</em>: left, right or boundary mark |
| 888 | </p> |
| 889 | </li> |
| 890 | <li> |
| 891 | <p> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 892 | <em>%n</em>: newline |
| 893 | </p> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 894 | </li> |
| Junio C Hamano | b78d259 | 2008-04-09 09:39:08 | [diff] [blame] | 895 | <li> |
| 896 | <p> |
| Junio C Hamano | a9701f0 | 2010-01-21 00:42:16 | [diff] [blame] | 897 | <em>%%</em>: a raw <em>%</em> |
| 898 | </p> |
| 899 | </li> |
| 900 | <li> |
| 901 | <p> |
| Junio C Hamano | b78d259 | 2008-04-09 09:39:08 | [diff] [blame] | 902 | <em>%x00</em>: print a byte from a hex code |
| 903 | </p> |
| 904 | </li> |
| Junio C Hamano | bf984de | 2009-11-23 06:11:19 | [diff] [blame] | 905 | <li> |
| 906 | <p> |
| 907 | <em>%w([<w>[,<i1>[,<i2>]]])</em>: switch line wrapping, like the -w option of |
| Junio C Hamano | 5706e0b | 2009-11-24 10:54:16 | [diff] [blame] | 908 | <a href="git-shortlog.html">git-shortlog(1)</a>. |
| Junio C Hamano | bf984de | 2009-11-23 06:11:19 | [diff] [blame] | 909 | </p> |
| 910 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 911 | </ul></div> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 912 | </li> |
| Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 913 | </ul></div> |
| 914 | <div class="admonitionblock"> |
| 915 | <table><tr> |
| 916 | <td class="icon"> |
| 917 | <div class="title">Note</div> |
| 918 | </td> |
| 919 | <td class="content">Some placeholders may depend on other options given to the |
| 920 | revision traversal engine. For example, the <tt>%g*</tt> reflog options will |
| 921 | insert an empty string unless we are traversing reflog entries (e.g., by |
| 922 | <tt>git log -g</tt>). The <tt>%d</tt> placeholder will use the "short" decoration |
| 923 | format if <tt>--decorate</tt> was not already provided on the command line.</td> |
| 924 | </tr></table> |
| 925 | </div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 926 | <div class="paragraph"><p>If you add a <tt>+</tt> (plus sign) after <em>%</em> of a placeholder, a line-feed |
| Junio C Hamano | 2bd8a74 | 2009-12-01 21:16:59 | [diff] [blame] | 927 | is inserted immediately before the expansion if and only if the |
| 928 | placeholder expands to a non-empty string.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 929 | <div class="paragraph"><p>If you add a <tt>-</tt> (minus sign) after <em>%</em> of a placeholder, line-feeds that |
| Junio C Hamano | 2bd8a74 | 2009-12-01 21:16:59 | [diff] [blame] | 930 | immediately precede the expansion are deleted if and only if the |
| 931 | placeholder expands to an empty string.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 932 | <div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 933 | is inserted immediately before the expansion if and only if the |
| 934 | placeholder expands to a non-empty string.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 935 | <div class="ulist"><ul> |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 936 | <li> |
| 937 | <p> |
| 938 | <em>tformat:</em> |
| 939 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 940 | <div class="paragraph"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 941 | provides "terminator" semantics instead of "separator" semantics. In |
| 942 | other words, each commit has the message terminator character (usually a |
| 943 | newline) appended, rather than a separator placed between entries. |
| 944 | This means that the final entry of a single-line format will be properly |
| 945 | terminated with a new line, just as the "oneline" format does. |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 946 | For example:</p></div> |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 947 | <div class="listingblock"> |
| 948 | <div class="content"> |
| 949 | <pre><tt>$ git log -2 --pretty=format:%h 4da45bef \ |
| 950 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 951 | 4da45be |
| 952 | 7134973 -- NO NEWLINE |
| 953 | |
| 954 | $ git log -2 --pretty=tformat:%h 4da45bef \ |
| 955 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 956 | 4da45be |
| 957 | 7134973</tt></pre> |
| 958 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 959 | <div class="paragraph"><p>In addition, any unrecognized string that has a <tt>%</tt> in it is interpreted |
| Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 960 | as if it has <tt>tformat:</tt> in front of it. For example, these two are |
| 961 | equivalent:</p></div> |
| 962 | <div class="listingblock"> |
| 963 | <div class="content"> |
| 964 | <pre><tt>$ git log -2 --pretty=tformat:%h 4da45bef |
| 965 | $ git log -2 --pretty=%h 4da45bef</tt></pre> |
| 966 | </div></div> |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 967 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 968 | </ul></div> |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 969 | </div> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 970 | <h2 id="_examples">EXAMPLES</h2> |
| Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 971 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 972 | <div class="dlist"><dl> |
| 973 | <dt class="hdlist1"> |
| Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 974 | git show v1.0.0 |
| 975 | </dt> |
| 976 | <dd> |
| 977 | <p> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 978 | Shows the tag <tt>v1.0.0</tt>, along with the object the tags |
| 979 | points at. |
| Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 980 | </p> |
| 981 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 982 | <dt class="hdlist1"> |
| Junio C Hamano | db911ee | 2007-02-28 08:13:52 | [diff] [blame] | 983 | git show v1.0.0^{tree} |
| Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 984 | </dt> |
| 985 | <dd> |
| 986 | <p> |
| 987 | Shows the tree pointed to by the tag <tt>v1.0.0</tt>. |
| 988 | </p> |
| 989 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 990 | <dt class="hdlist1"> |
| Junio C Hamano | c3fda57 | 2010-11-09 19:41:30 | [diff] [blame] | 991 | git show -s --format=%s v1.0.0^{commit} |
| 992 | </dt> |
| 993 | <dd> |
| 994 | <p> |
| 995 | Shows the subject of the commit pointed to by the |
| 996 | tag <tt>v1.0.0</tt>. |
| 997 | </p> |
| 998 | </dd> |
| 999 | <dt class="hdlist1"> |
| Junio C Hamano | db911ee | 2007-02-28 08:13:52 | [diff] [blame] | 1000 | git show next~10:Documentation/README |
| 1001 | </dt> |
| 1002 | <dd> |
| 1003 | <p> |
| Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 1004 | Shows the contents of the file <tt>Documentation/README</tt> as |
| 1005 | they were current in the 10th last commit of the branch |
| Junio C Hamano | db911ee | 2007-02-28 08:13:52 | [diff] [blame] | 1006 | <tt>next</tt>. |
| 1007 | </p> |
| 1008 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1009 | <dt class="hdlist1"> |
| Junio C Hamano | db911ee | 2007-02-28 08:13:52 | [diff] [blame] | 1010 | git show master:Makefile master:t/Makefile |
| 1011 | </dt> |
| 1012 | <dd> |
| 1013 | <p> |
| Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 1014 | Concatenates the contents of said Makefiles in the head |
| Junio C Hamano | db911ee | 2007-02-28 08:13:52 | [diff] [blame] | 1015 | of the branch <tt>master</tt>. |
| 1016 | </p> |
| 1017 | </dd> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1018 | </dl></div> |
| Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 1019 | </div> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1020 | <h2 id="_discussion">Discussion</h2> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1021 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1022 | <div class="paragraph"><p>At the core level, git is character encoding agnostic.</p></div> |
| 1023 | <div class="ulist"><ul> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1024 | <li> |
| 1025 | <p> |
| 1026 | The pathnames recorded in the index and in the tree objects |
| 1027 | are treated as uninterpreted sequences of non-NUL bytes. |
| 1028 | What readdir(2) returns are what are recorded and compared |
| 1029 | with the data git keeps track of, which in turn are expected |
| 1030 | to be what lstat(2) and creat(2) accepts. There is no such |
| 1031 | thing as pathname encoding translation. |
| 1032 | </p> |
| 1033 | </li> |
| 1034 | <li> |
| 1035 | <p> |
| Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 1036 | The contents of the blob objects are uninterpreted sequences |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1037 | of bytes. There is no encoding translation at the core |
| 1038 | level. |
| 1039 | </p> |
| 1040 | </li> |
| 1041 | <li> |
| 1042 | <p> |
| Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 1043 | The commit log messages are uninterpreted sequences of non-NUL |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1044 | bytes. |
| 1045 | </p> |
| 1046 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1047 | </ul></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1048 | <div class="paragraph"><p>Although we encourage that the commit log messages are encoded |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1049 | in UTF-8, both the core and git Porcelain are designed not to |
| 1050 | force UTF-8 on projects. If all participants of a particular |
| 1051 | project find it more convenient to use legacy encodings, git |
| 1052 | does not forbid it. However, there are a few things to keep in |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1053 | mind.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1054 | <div class="olist arabic"><ol class="arabic"> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1055 | <li> |
| 1056 | <p> |
| Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1057 | <em>git commit</em> and <em>git commit-tree</em> issues |
| Junio C Hamano | 14b7648 | 2008-01-05 10:32:26 | [diff] [blame] | 1058 | a warning if the commit log message given to it does not look |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1059 | like a valid UTF-8 string, unless you explicitly say your |
| 1060 | project uses a legacy encoding. The way to say this is to |
| Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 1061 | have i18n.commitencoding in <tt>.git/config</tt> file, like this: |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1062 | </p> |
| 1063 | <div class="listingblock"> |
| 1064 | <div class="content"> |
| Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 1065 | <pre><tt>[i18n] |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1066 | commitencoding = ISO-8859-1</tt></pre> |
| 1067 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1068 | <div class="paragraph"><p>Commit objects created with the above setting record the value |
| Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 1069 | of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1070 | help other people who look at them later. Lack of this header |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1071 | implies that the commit log message is encoded in UTF-8.</p></div> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1072 | </li> |
| 1073 | <li> |
| 1074 | <p> |
| Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1075 | <em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the |
| Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 1076 | <tt>encoding</tt> header of a commit object, and try to re-code the |
| 1077 | log message into UTF-8 unless otherwise specified. You can |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1078 | specify the desired output encoding with |
| Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 1079 | <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this: |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1080 | </p> |
| 1081 | <div class="listingblock"> |
| 1082 | <div class="content"> |
| Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 1083 | <pre><tt>[i18n] |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1084 | logoutputencoding = ISO-8859-1</tt></pre> |
| 1085 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1086 | <div class="paragraph"><p>If you do not have this configuration variable, the value of |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1087 | <tt>i18n.commitencoding</tt> is used instead.</p></div> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1088 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1089 | </ol></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1090 | <div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1091 | message when a commit is made to force UTF-8 at the commit |
| 1092 | object level, because re-coding to UTF-8 is not necessarily a |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1093 | reversible operation.</p></div> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1094 | </div> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1095 | <h2 id="_git">GIT</h2> |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 1096 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1097 | <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div> |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 1098 | </div> |
| 1099 | <div id="footer"> |
| 1100 | <div id="footer-text"> |
| Junio C Hamano | 5f3d839 | 2011-03-15 23:33:35 | [diff] [blame] | 1101 | Last updated 2011-03-15 23:30:14 UTC |
| Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 1102 | </div> |
| 1103 | </div> |
| 1104 | </body> |
| 1105 | </html> |