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" /> |
| 6 | <meta name="generator" content="AsciiDoc 7.0.2" /> |
| 7 | <style type="text/css"> |
| 8 | /* Debug borders */ |
| 9 | p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { |
| 10 | /* |
| 11 | border: 1px solid red; |
| 12 | */ |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | margin: 1em 5% 1em 5%; |
| 17 | } |
| 18 | |
| 19 | a { color: blue; } |
| 20 | a:visited { color: fuchsia; } |
| 21 | |
| 22 | em { |
| 23 | font-style: italic; |
| 24 | } |
| 25 | |
| 26 | strong { |
| 27 | font-weight: bold; |
| 28 | } |
| 29 | |
| 30 | tt { |
| 31 | color: navy; |
| 32 | } |
| 33 | |
| 34 | h1, h2, h3, h4, h5, h6 { |
| 35 | color: #527bbd; |
| 36 | font-family: sans-serif; |
| 37 | margin-top: 1.2em; |
| 38 | margin-bottom: 0.5em; |
| 39 | line-height: 1.3; |
| 40 | } |
| 41 | |
| 42 | h1 { |
| 43 | border-bottom: 2px solid silver; |
| 44 | } |
| 45 | h2 { |
| 46 | border-bottom: 2px solid silver; |
| 47 | padding-top: 0.5em; |
| 48 | } |
| 49 | |
| 50 | div.sectionbody { |
| 51 | font-family: serif; |
| 52 | margin-left: 0; |
| 53 | } |
| 54 | |
| 55 | hr { |
| 56 | border: 1px solid silver; |
| 57 | } |
| 58 | |
| 59 | p { |
| 60 | margin-top: 0.5em; |
| 61 | margin-bottom: 0.5em; |
| 62 | } |
| 63 | |
| 64 | pre { |
| 65 | padding: 0; |
| 66 | margin: 0; |
| 67 | } |
| 68 | |
| 69 | span#author { |
| 70 | color: #527bbd; |
| 71 | font-family: sans-serif; |
| 72 | font-weight: bold; |
| 73 | font-size: 1.2em; |
| 74 | } |
| 75 | span#email { |
| 76 | } |
| 77 | span#revision { |
| 78 | font-family: sans-serif; |
| 79 | } |
| 80 | |
| 81 | div#footer { |
| 82 | font-family: sans-serif; |
| 83 | font-size: small; |
| 84 | border-top: 2px solid silver; |
| 85 | padding-top: 0.5em; |
| 86 | margin-top: 4.0em; |
| 87 | } |
| 88 | div#footer-text { |
| 89 | float: left; |
| 90 | padding-bottom: 0.5em; |
| 91 | } |
| 92 | div#footer-badges { |
| 93 | float: right; |
| 94 | padding-bottom: 0.5em; |
| 95 | } |
| 96 | |
| 97 | div#preamble, |
| 98 | div.tableblock, div.imageblock, div.exampleblock, div.verseblock, |
| 99 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 100 | div.admonitionblock { |
| 101 | margin-right: 10%; |
| 102 | margin-top: 1.5em; |
| 103 | margin-bottom: 1.5em; |
| 104 | } |
| 105 | div.admonitionblock { |
| 106 | margin-top: 2.5em; |
| 107 | margin-bottom: 2.5em; |
| 108 | } |
| 109 | |
| 110 | div.content { /* Block element content. */ |
| 111 | padding: 0; |
| 112 | } |
| 113 | |
| 114 | /* Block element titles. */ |
| 115 | div.title, caption.title { |
| 116 | font-family: sans-serif; |
| 117 | font-weight: bold; |
| 118 | text-align: left; |
| 119 | margin-top: 1.0em; |
| 120 | margin-bottom: 0.5em; |
| 121 | } |
| 122 | div.title + * { |
| 123 | margin-top: 0; |
| 124 | } |
| 125 | |
| 126 | td div.title:first-child { |
| 127 | margin-top: 0.0em; |
| 128 | } |
| 129 | div.content div.title:first-child { |
| 130 | margin-top: 0.0em; |
| 131 | } |
| 132 | div.content + div.title { |
| 133 | margin-top: 0.0em; |
| 134 | } |
| 135 | |
| 136 | div.sidebarblock > div.content { |
| 137 | background: #ffffee; |
| 138 | border: 1px solid silver; |
| 139 | padding: 0.5em; |
| 140 | } |
| 141 | |
| 142 | div.listingblock > div.content { |
| 143 | border: 1px solid silver; |
| 144 | background: #f4f4f4; |
| 145 | padding: 0.5em; |
| 146 | } |
| 147 | |
| 148 | div.quoteblock > div.content { |
| 149 | padding-left: 2.0em; |
| 150 | } |
| 151 | div.quoteblock .attribution { |
| 152 | text-align: right; |
| 153 | } |
| 154 | |
| 155 | div.admonitionblock .icon { |
| 156 | vertical-align: top; |
| 157 | font-size: 1.1em; |
| 158 | font-weight: bold; |
| 159 | text-decoration: underline; |
| 160 | color: #527bbd; |
| 161 | padding-right: 0.5em; |
| 162 | } |
| 163 | div.admonitionblock td.content { |
| 164 | padding-left: 0.5em; |
| 165 | border-left: 2px solid silver; |
| 166 | } |
| 167 | |
| 168 | div.exampleblock > div.content { |
| 169 | border-left: 2px solid silver; |
| 170 | padding: 0.5em; |
| 171 | } |
| 172 | |
| 173 | div.verseblock div.content { |
| 174 | white-space: pre; |
| 175 | } |
| 176 | |
| 177 | div.imageblock div.content { padding-left: 0; } |
| 178 | div.imageblock img { border: 1px solid silver; } |
| 179 | span.image img { border-style: none; } |
| 180 | |
| 181 | dl { |
| 182 | margin-top: 0.8em; |
| 183 | margin-bottom: 0.8em; |
| 184 | } |
| 185 | dt { |
| 186 | margin-top: 0.5em; |
| 187 | margin-bottom: 0; |
| 188 | font-style: italic; |
| 189 | } |
| 190 | dd > *:first-child { |
| 191 | margin-top: 0; |
| 192 | } |
| 193 | |
| 194 | ul, ol { |
| 195 | list-style-position: outside; |
| 196 | } |
| 197 | ol.olist2 { |
| 198 | list-style-type: lower-alpha; |
| 199 | } |
| 200 | |
| 201 | div.tableblock > table { |
| 202 | border-color: #527bbd; |
| 203 | border-width: 3px; |
| 204 | } |
| 205 | thead { |
| 206 | font-family: sans-serif; |
| 207 | font-weight: bold; |
| 208 | } |
| 209 | tfoot { |
| 210 | font-weight: bold; |
| 211 | } |
| 212 | |
| 213 | div.hlist { |
| 214 | margin-top: 0.8em; |
| 215 | margin-bottom: 0.8em; |
| 216 | } |
| 217 | td.hlist1 { |
| 218 | vertical-align: top; |
| 219 | font-style: italic; |
| 220 | padding-right: 0.8em; |
| 221 | } |
| 222 | td.hlist2 { |
| 223 | vertical-align: top; |
| 224 | } |
| 225 | |
| 226 | @media print { |
| 227 | div#footer-badges { display: none; } |
| 228 | } |
| 229 | include::./stylesheets/xhtml11-manpage.css[] |
| 230 | /* Workarounds for IE6's broken and incomplete CSS2. */ |
| 231 | |
| 232 | div.sidebar-content { |
| 233 | background: #ffffee; |
| 234 | border: 1px solid silver; |
| 235 | padding: 0.5em; |
| 236 | } |
| 237 | div.sidebar-title, div.image-title { |
| 238 | font-family: sans-serif; |
| 239 | font-weight: bold; |
| 240 | margin-top: 0.0em; |
| 241 | margin-bottom: 0.5em; |
| 242 | } |
| 243 | |
| 244 | div.listingblock div.content { |
| 245 | border: 1px solid silver; |
| 246 | background: #f4f4f4; |
| 247 | padding: 0.5em; |
| 248 | } |
| 249 | |
| 250 | div.quoteblock-content { |
| 251 | padding-left: 2.0em; |
| 252 | } |
| 253 | |
| 254 | div.exampleblock-content { |
| 255 | border-left: 2px solid silver; |
| 256 | padding-left: 0.5em; |
| 257 | } |
| 258 | </style> |
| 259 | <title>git-show(1)</title> |
| 260 | </head> |
| 261 | <body> |
| 262 | <div id="header"> |
| 263 | <h1> |
| 264 | git-show(1) Manual Page |
| 265 | </h1> |
| 266 | <h2>NAME</h2> |
| 267 | <div class="sectionbody"> |
| 268 | <p>git-show - |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 269 | Show various types of objects |
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 270 | </p> |
| 271 | </div> |
| 272 | </div> |
| 273 | <h2>SYNOPSIS</h2> |
| 274 | <div class="sectionbody"> |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 275 | <p><em>git-show</em> [options] <object>…</p> |
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 276 | </div> |
| 277 | <h2>DESCRIPTION</h2> |
| 278 | <div class="sectionbody"> |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 279 | <p>Shows one or more objects (blobs, trees, tags and commits).</p> |
| 280 | <p>For commits it shows the log message and textual diff. It also |
| 281 | presents the merge commit in a special format as produced by |
| 282 | <em>git-diff-tree --cc</em>.</p> |
| 283 | <p>For tags, it shows the tag message and the referenced objects.</p> |
| 284 | <p>For trees, it shows the names (equivalent to <a href="git-ls-tree.html">git-ls-tree(1)</a> |
| 285 | with --name-only).</p> |
| 286 | <p>For plain blobs, it shows the plain contents.</p> |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 287 | <p>The command takes options applicable to the <a href="git-diff-tree.html">git-diff-tree(1)</a> command to |
| 288 | control how the changes the commit introduces are shown.</p> |
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 289 | <p>This manual page describes only the most frequently used options.</p> |
| 290 | </div> |
| 291 | <h2>OPTIONS</h2> |
| 292 | <div class="sectionbody"> |
| 293 | <dl> |
| 294 | <dt> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 295 | <object> |
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 296 | </dt> |
| 297 | <dd> |
| 298 | <p> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 299 | The name of the object to show. |
Junio C Hamano | 2d47c62 | 2007-01-18 06:24:10 | [diff] [blame] | 300 | For a more complete list of ways to spell object names, see |
| 301 | "SPECIFYING REVISIONS" section in <a href="git-rev-parse.html">git-rev-parse(1)</a>. |
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 302 | </p> |
| 303 | </dd> |
| 304 | <dt> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 305 | --pretty[=<em><format></em>] |
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 306 | </dt> |
| 307 | <dd> |
| 308 | <p> |
Junio C Hamano | a3770f9 | 2007-07-25 08:53:33 | [diff] [blame] | 309 | Pretty-print the contents of the commit logs in a given format, |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 310 | where <em><format></em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>, |
| 311 | <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:<string></em>. |
Junio C Hamano | a3770f9 | 2007-07-25 08:53:33 | [diff] [blame] | 312 | When omitted, the format defaults to <em>medium</em>. |
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 313 | </p> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 314 | </dd> |
| 315 | <dt> |
Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 316 | --abbrev-commit |
| 317 | </dt> |
| 318 | <dd> |
| 319 | <p> |
| 320 | Instead of showing the full 40-byte hexadecimal commit object |
| 321 | name, show only handful hexdigits prefix. Non default number of |
| 322 | digits can be specified with "--abbrev=<n>" (which also modifies |
| 323 | diff output, if it is displayed). |
| 324 | </p> |
| 325 | <p>This should make "--pretty=oneline" a whole lot more readable for |
| 326 | people using 80-column terminals.</p> |
| 327 | </dd> |
| 328 | <dt> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 329 | --encoding[=<encoding>] |
| 330 | </dt> |
| 331 | <dd> |
| 332 | <p> |
| 333 | The commit objects record the encoding used for the log message |
| 334 | in their encoding header; this option can be used to tell the |
| 335 | command to re-code the commit log message in the encoding |
| 336 | preferred by the user. For non plumbing commands this |
| 337 | defaults to UTF-8. |
| 338 | </p> |
| 339 | </dd> |
| 340 | </dl> |
| 341 | </div> |
| 342 | <h2>PRETTY FORMATS</h2> |
| 343 | <div class="sectionbody"> |
| 344 | <p>If the commit is a merge, and if the pretty-format |
| 345 | is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is |
| 346 | inserted before the <em>Author:</em> line. This line begins with |
| 347 | "Merge: " and the sha1s of ancestral commits are printed, |
| 348 | separated by spaces. Note that the listed commits may not |
| 349 | necessarily be the list of the <strong>direct</strong> parent commits if you |
| 350 | have limited your view of history: for example, if you are |
| 351 | only interested in changes related to a certain directory or |
| 352 | file.</p> |
| 353 | <p>Here are some additional details for each format:</p> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 354 | <ul> |
| 355 | <li> |
| 356 | <p> |
| 357 | <em>oneline</em> |
| 358 | </p> |
| 359 | <div class="literalblock"> |
| 360 | <div class="content"> |
| 361 | <pre><tt><sha1> <title line></tt></pre> |
| 362 | </div></div> |
| 363 | <p>This is designed to be as compact as possible.</p> |
| 364 | </li> |
| 365 | <li> |
| 366 | <p> |
| 367 | <em>short</em> |
| 368 | </p> |
| 369 | <div class="literalblock"> |
| 370 | <div class="content"> |
| 371 | <pre><tt>commit <sha1> |
| 372 | Author: <author></tt></pre> |
| 373 | </div></div> |
| 374 | <div class="literalblock"> |
| 375 | <div class="content"> |
| 376 | <pre><tt><title line></tt></pre> |
| 377 | </div></div> |
| 378 | </li> |
| 379 | <li> |
| 380 | <p> |
| 381 | <em>medium</em> |
| 382 | </p> |
| 383 | <div class="literalblock"> |
| 384 | <div class="content"> |
| 385 | <pre><tt>commit <sha1> |
| 386 | Author: <author> |
| 387 | Date: <date></tt></pre> |
| 388 | </div></div> |
| 389 | <div class="literalblock"> |
| 390 | <div class="content"> |
| 391 | <pre><tt><title line></tt></pre> |
| 392 | </div></div> |
| 393 | <div class="literalblock"> |
| 394 | <div class="content"> |
| 395 | <pre><tt><full commit message></tt></pre> |
| 396 | </div></div> |
| 397 | </li> |
| 398 | <li> |
| 399 | <p> |
| 400 | <em>full</em> |
| 401 | </p> |
| 402 | <div class="literalblock"> |
| 403 | <div class="content"> |
| 404 | <pre><tt>commit <sha1> |
| 405 | Author: <author> |
| 406 | Commit: <committer></tt></pre> |
| 407 | </div></div> |
| 408 | <div class="literalblock"> |
| 409 | <div class="content"> |
| 410 | <pre><tt><title line></tt></pre> |
| 411 | </div></div> |
| 412 | <div class="literalblock"> |
| 413 | <div class="content"> |
| 414 | <pre><tt><full commit message></tt></pre> |
| 415 | </div></div> |
| 416 | </li> |
| 417 | <li> |
| 418 | <p> |
| 419 | <em>fuller</em> |
| 420 | </p> |
| 421 | <div class="literalblock"> |
| 422 | <div class="content"> |
| 423 | <pre><tt>commit <sha1> |
| 424 | Author: <author> |
| 425 | AuthorDate: <date & time> |
| 426 | Commit: <committer> |
| 427 | CommitDate: <date & time></tt></pre> |
| 428 | </div></div> |
| 429 | <div class="literalblock"> |
| 430 | <div class="content"> |
| 431 | <pre><tt><title line></tt></pre> |
| 432 | </div></div> |
| 433 | <div class="literalblock"> |
| 434 | <div class="content"> |
| 435 | <pre><tt><full commit message></tt></pre> |
| 436 | </div></div> |
| 437 | </li> |
| 438 | <li> |
| 439 | <p> |
| 440 | <em>email</em> |
| 441 | </p> |
| 442 | <div class="literalblock"> |
| 443 | <div class="content"> |
| 444 | <pre><tt>From <sha1> <date> |
| 445 | From: <author> |
| 446 | Date: <date & time> |
| 447 | Subject: [PATCH] <title line></tt></pre> |
| 448 | </div></div> |
| 449 | <div class="literalblock"> |
| 450 | <div class="content"> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 451 | <pre><tt><full commit message></tt></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 452 | </div></div> |
| 453 | </li> |
| 454 | <li> |
| 455 | <p> |
| 456 | <em>raw</em> |
| 457 | </p> |
| 458 | <p>The <em>raw</em> format shows the entire commit exactly as |
| 459 | stored in the commit object. Notably, the SHA1s are |
| 460 | displayed in full, regardless of whether --abbrev or |
| 461 | --no-abbrev are used, and <em>parents</em> information show the |
| 462 | true parent commits, without taking grafts nor history |
| 463 | simplification into account.</p> |
| 464 | </li> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 465 | <li> |
| 466 | <p> |
| 467 | <em>format:</em> |
| 468 | </p> |
| 469 | <p>The <em>format:</em> format allows you to specify which information |
| 470 | you want to show. It works a little bit like printf format, |
| 471 | with the notable exception that you get a newline with <em>%n</em> |
| 472 | instead of <em>\n</em>.</p> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 473 | <p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was >>%s<<%n"</em> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 474 | would show something like this:</p> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 475 | <div class="listingblock"> |
| 476 | <div class="content"> |
| 477 | <pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago |
| 478 | The title was >>t4119: test autocomputing -p<n> for traditional diff input.<< |
| 479 | </tt></pre> |
| 480 | </div></div> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 481 | <p>The placeholders are:</p> |
| 482 | <ul> |
| 483 | <li> |
| 484 | <p> |
| 485 | <em>%H</em>: commit hash |
| 486 | </p> |
| 487 | </li> |
| 488 | <li> |
| 489 | <p> |
| 490 | <em>%h</em>: abbreviated commit hash |
| 491 | </p> |
| 492 | </li> |
| 493 | <li> |
| 494 | <p> |
| 495 | <em>%T</em>: tree hash |
| 496 | </p> |
| 497 | </li> |
| 498 | <li> |
| 499 | <p> |
| 500 | <em>%t</em>: abbreviated tree hash |
| 501 | </p> |
| 502 | </li> |
| 503 | <li> |
| 504 | <p> |
| 505 | <em>%P</em>: parent hashes |
| 506 | </p> |
| 507 | </li> |
| 508 | <li> |
| 509 | <p> |
| 510 | <em>%p</em>: abbreviated parent hashes |
| 511 | </p> |
| 512 | </li> |
| 513 | <li> |
| 514 | <p> |
| 515 | <em>%an</em>: author name |
| 516 | </p> |
| 517 | </li> |
| 518 | <li> |
| 519 | <p> |
| 520 | <em>%ae</em>: author email |
| 521 | </p> |
| 522 | </li> |
| 523 | <li> |
| 524 | <p> |
| 525 | <em>%ad</em>: author date |
| 526 | </p> |
| 527 | </li> |
| 528 | <li> |
| 529 | <p> |
| 530 | <em>%aD</em>: author date, RFC2822 style |
| 531 | </p> |
| 532 | </li> |
| 533 | <li> |
| 534 | <p> |
| 535 | <em>%ar</em>: author date, relative |
| 536 | </p> |
| 537 | </li> |
| 538 | <li> |
| 539 | <p> |
| 540 | <em>%at</em>: author date, UNIX timestamp |
| 541 | </p> |
| 542 | </li> |
| 543 | <li> |
| 544 | <p> |
Junio C Hamano | 02f130b | 2007-07-14 08:26:56 | [diff] [blame] | 545 | <em>%ai</em>: author date, ISO 8601 format |
| 546 | </p> |
| 547 | </li> |
| 548 | <li> |
| 549 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 550 | <em>%cn</em>: committer name |
| 551 | </p> |
| 552 | </li> |
| 553 | <li> |
| 554 | <p> |
| 555 | <em>%ce</em>: committer email |
| 556 | </p> |
| 557 | </li> |
| 558 | <li> |
| 559 | <p> |
| 560 | <em>%cd</em>: committer date |
| 561 | </p> |
| 562 | </li> |
| 563 | <li> |
| 564 | <p> |
| 565 | <em>%cD</em>: committer date, RFC2822 style |
| 566 | </p> |
| 567 | </li> |
| 568 | <li> |
| 569 | <p> |
| 570 | <em>%cr</em>: committer date, relative |
| 571 | </p> |
| 572 | </li> |
| 573 | <li> |
| 574 | <p> |
| 575 | <em>%ct</em>: committer date, UNIX timestamp |
| 576 | </p> |
| 577 | </li> |
| 578 | <li> |
| 579 | <p> |
Junio C Hamano | 02f130b | 2007-07-14 08:26:56 | [diff] [blame] | 580 | <em>%ci</em>: committer date, ISO 8601 format |
| 581 | </p> |
| 582 | </li> |
| 583 | <li> |
| 584 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 585 | <em>%e</em>: encoding |
| 586 | </p> |
| 587 | </li> |
| 588 | <li> |
| 589 | <p> |
| 590 | <em>%s</em>: subject |
| 591 | </p> |
| 592 | </li> |
| 593 | <li> |
| 594 | <p> |
| 595 | <em>%b</em>: body |
| 596 | </p> |
| 597 | </li> |
| 598 | <li> |
| 599 | <p> |
| 600 | <em>%Cred</em>: switch color to red |
| 601 | </p> |
| 602 | </li> |
| 603 | <li> |
| 604 | <p> |
| 605 | <em>%Cgreen</em>: switch color to green |
| 606 | </p> |
| 607 | </li> |
| 608 | <li> |
| 609 | <p> |
| 610 | <em>%Cblue</em>: switch color to blue |
| 611 | </p> |
| 612 | </li> |
| 613 | <li> |
| 614 | <p> |
| 615 | <em>%Creset</em>: reset color |
| 616 | </p> |
| 617 | </li> |
| 618 | <li> |
| 619 | <p> |
Junio C Hamano | d9e0e5d | 2007-04-14 16:22:04 | [diff] [blame] | 620 | <em>%m</em>: left, right or boundary mark |
| 621 | </p> |
| 622 | </li> |
| 623 | <li> |
| 624 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 625 | <em>%n</em>: newline |
| 626 | </p> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 627 | </li> |
| 628 | </ul> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 629 | </li> |
| 630 | </ul> |
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 631 | </div> |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 632 | <h2>EXAMPLES</h2> |
| 633 | <div class="sectionbody"> |
| 634 | <dl> |
| 635 | <dt> |
| 636 | git show v1.0.0 |
| 637 | </dt> |
| 638 | <dd> |
| 639 | <p> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 640 | Shows the tag <tt>v1.0.0</tt>, along with the object the tags |
| 641 | points at. |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 642 | </p> |
| 643 | </dd> |
| 644 | <dt> |
Junio C Hamano | db911ee | 2007-02-28 08:13:52 | [diff] [blame] | 645 | git show v1.0.0^{tree} |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 646 | </dt> |
| 647 | <dd> |
| 648 | <p> |
| 649 | Shows the tree pointed to by the tag <tt>v1.0.0</tt>. |
| 650 | </p> |
| 651 | </dd> |
Junio C Hamano | db911ee | 2007-02-28 08:13:52 | [diff] [blame] | 652 | <dt> |
| 653 | git show next~10:Documentation/README |
| 654 | </dt> |
| 655 | <dd> |
| 656 | <p> |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 657 | Shows the contents of the file <tt>Documentation/README</tt> as |
| 658 | they were current in the 10th last commit of the branch |
Junio C Hamano | db911ee | 2007-02-28 08:13:52 | [diff] [blame] | 659 | <tt>next</tt>. |
| 660 | </p> |
| 661 | </dd> |
| 662 | <dt> |
| 663 | git show master:Makefile master:t/Makefile |
| 664 | </dt> |
| 665 | <dd> |
| 666 | <p> |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 667 | Concatenates the contents of said Makefiles in the head |
Junio C Hamano | db911ee | 2007-02-28 08:13:52 | [diff] [blame] | 668 | of the branch <tt>master</tt>. |
| 669 | </p> |
| 670 | </dd> |
| 671 | </dl> |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 672 | </div> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 673 | <h2>Discussion</h2> |
| 674 | <div class="sectionbody"> |
| 675 | <p>At the core level, git is character encoding agnostic.</p> |
| 676 | <ul> |
| 677 | <li> |
| 678 | <p> |
| 679 | The pathnames recorded in the index and in the tree objects |
| 680 | are treated as uninterpreted sequences of non-NUL bytes. |
| 681 | What readdir(2) returns are what are recorded and compared |
| 682 | with the data git keeps track of, which in turn are expected |
| 683 | to be what lstat(2) and creat(2) accepts. There is no such |
| 684 | thing as pathname encoding translation. |
| 685 | </p> |
| 686 | </li> |
| 687 | <li> |
| 688 | <p> |
| 689 | The contents of the blob objects are uninterpreted sequence |
| 690 | of bytes. There is no encoding translation at the core |
| 691 | level. |
| 692 | </p> |
| 693 | </li> |
| 694 | <li> |
| 695 | <p> |
| 696 | The commit log messages are uninterpreted sequence of non-NUL |
| 697 | bytes. |
| 698 | </p> |
| 699 | </li> |
| 700 | </ul> |
| 701 | <p>Although we encourage that the commit log messages are encoded |
| 702 | in UTF-8, both the core and git Porcelain are designed not to |
| 703 | force UTF-8 on projects. If all participants of a particular |
| 704 | project find it more convenient to use legacy encodings, git |
| 705 | does not forbid it. However, there are a few things to keep in |
| 706 | mind.</p> |
| 707 | <ol> |
| 708 | <li> |
| 709 | <p> |
| 710 | <tt>git-commit-tree</tt> (hence, <tt>git-commit</tt> which uses it) issues |
Junio C Hamano | 14b7648 | 2008-01-05 10:32:26 | [diff] [blame] | 711 | 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] | 712 | like a valid UTF-8 string, unless you explicitly say your |
| 713 | project uses a legacy encoding. The way to say this is to |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 714 | have i18n.commitencoding in <tt>.git/config</tt> file, like this: |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 715 | </p> |
| 716 | <div class="listingblock"> |
| 717 | <div class="content"> |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 718 | <pre><tt>[i18n] |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 719 | commitencoding = ISO-8859-1</tt></pre> |
| 720 | </div></div> |
| 721 | <p>Commit objects created with the above setting record the value |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 722 | 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] | 723 | help other people who look at them later. Lack of this header |
| 724 | implies that the commit log message is encoded in UTF-8.</p> |
| 725 | </li> |
| 726 | <li> |
| 727 | <p> |
| 728 | <tt>git-log</tt>, <tt>git-show</tt> and friends looks at the <tt>encoding</tt> |
| 729 | header of a commit object, and tries to re-code the log |
| 730 | message into UTF-8 unless otherwise specified. You can |
| 731 | specify the desired output encoding with |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 732 | <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this: |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 733 | </p> |
| 734 | <div class="listingblock"> |
| 735 | <div class="content"> |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 736 | <pre><tt>[i18n] |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 737 | logoutputencoding = ISO-8859-1</tt></pre> |
| 738 | </div></div> |
| 739 | <p>If you do not have this configuration variable, the value of |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 740 | <tt>i18n.commitencoding</tt> is used instead.</p> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 741 | </li> |
| 742 | </ol> |
| 743 | <p>Note that we deliberately chose not to re-code the commit log |
| 744 | message when a commit is made to force UTF-8 at the commit |
| 745 | object level, because re-coding to UTF-8 is not necessarily a |
| 746 | reversible operation.</p> |
| 747 | </div> |
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 748 | <h2>Author</h2> |
| 749 | <div class="sectionbody"> |
| 750 | <p>Written by Linus Torvalds <torvalds@osdl.org> and |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 751 | Junio C Hamano <junkio@cox.net>. Significantly enhanced by |
| 752 | Johannes Schindelin <Johannes.Schindelin@gmx.de>.</p> |
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 753 | </div> |
| 754 | <h2>Documentation</h2> |
| 755 | <div class="sectionbody"> |
| 756 | <p>Documentation by David Greaves, Petr Baudis and the git-list <git@vger.kernel.org>.</p> |
| 757 | <p>This manual page is a stub. You can help the git documentation by expanding it.</p> |
| 758 | </div> |
| 759 | <h2>GIT</h2> |
| 760 | <div class="sectionbody"> |
| 761 | <p>Part of the <a href="git.html">git(7)</a> suite</p> |
| 762 | </div> |
| 763 | <div id="footer"> |
| 764 | <div id="footer-text"> |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 765 | Last updated 07-Jan-2008 07:50:48 UTC |
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 766 | </div> |
| 767 | </div> |
| 768 | </body> |
| 769 | </html> |