Autogenerated HTML docs for v1.7.3-rc0-38-g9ab5a
[git/jnareb-git.git] / git-show.html
blob927a765c5eac518b882bb1d5ffaec57043a98b34
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <meta name="generator" content="AsciiDoc 8.2.5" />
7 <style type="text/css">
8 /* Debug borders */
9 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
11 border: 1px solid red;
15 body {
16 margin: 1em 5% 1em 5%;
19 a {
20 color: blue;
21 text-decoration: underline;
23 a:visited {
24 color: fuchsia;
27 em {
28 font-style: italic;
31 strong {
32 font-weight: bold;
35 tt {
36 color: navy;
39 h1, h2, h3, h4, h5, h6 {
40 color: #527bbd;
41 font-family: sans-serif;
42 margin-top: 1.2em;
43 margin-bottom: 0.5em;
44 line-height: 1.3;
47 h1, h2, h3 {
48 border-bottom: 2px solid silver;
50 h2 {
51 padding-top: 0.5em;
53 h3 {
54 float: left;
56 h3 + * {
57 clear: left;
60 div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
65 hr {
66 border: 1px solid silver;
69 p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
74 pre {
75 padding: 0;
76 margin: 0;
79 span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
83 font-size: 1.1em;
85 span#email {
87 span#revision {
88 font-family: sans-serif;
91 div#footer {
92 font-family: sans-serif;
93 font-size: small;
94 border-top: 2px solid silver;
95 padding-top: 0.5em;
96 margin-top: 4.0em;
98 div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
102 div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
107 div#preamble,
108 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110 div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
115 div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
120 div.content { /* Block element content. */
121 padding: 0;
124 /* Block element titles. */
125 div.title, caption.title {
126 font-family: sans-serif;
127 font-weight: bold;
128 text-align: left;
129 margin-top: 1.0em;
130 margin-bottom: 0.5em;
132 div.title + * {
133 margin-top: 0;
136 td div.title:first-child {
137 margin-top: 0.0em;
139 div.content div.title:first-child {
140 margin-top: 0.0em;
142 div.content + div.title {
143 margin-top: 0.0em;
146 div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
152 div.listingblock {
153 margin-right: 0%;
155 div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
161 div.quoteblock > div.content {
162 padding-left: 2.0em;
165 div.attribution {
166 text-align: right;
168 div.verseblock + div.attribution {
169 text-align: left;
172 div.admonitionblock .icon {
173 vertical-align: top;
174 font-size: 1.1em;
175 font-weight: bold;
176 text-decoration: underline;
177 color: #527bbd;
178 padding-right: 0.5em;
180 div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
185 div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
190 div.verseblock div.content {
191 white-space: pre;
194 div.imageblock div.content { padding-left: 0; }
195 div.imageblock img { border: 1px solid silver; }
196 span.image img { border-style: none; }
198 dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
202 dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
207 dd > *:first-child {
208 margin-top: 0;
211 ul, ol {
212 list-style-position: outside;
214 div.olist2 ol {
215 list-style-type: lower-alpha;
218 div.tableblock > table {
219 border: 3px solid #527bbd;
221 thead {
222 font-family: sans-serif;
223 font-weight: bold;
225 tfoot {
226 font-weight: bold;
229 div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
233 div.hlist td {
234 padding-bottom: 5px;
236 td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
241 td.hlist2 {
242 vertical-align: top;
245 @media print {
246 div#footer-badges { display: none; }
249 div#toctitle {
250 color: #527bbd;
251 font-family: sans-serif;
252 font-size: 1.1em;
253 font-weight: bold;
254 margin-top: 1.0em;
255 margin-bottom: 0.1em;
258 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
262 div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
266 div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
270 div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
274 include1::./stylesheets/xhtml11-manpage.css[]
275 /* Workarounds for IE6's broken and incomplete CSS2. */
277 div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
282 div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
289 div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
295 div.quoteblock-content {
296 padding-left: 2.0em;
299 div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
304 /* IE6 sets dynamically generated links as visited. */
305 div#toc a:visited { color: blue; }
306 </style>
307 <title>git-show(1)</title>
308 </head>
309 <body>
310 <div id="header">
311 <h1>
312 git-show(1) Manual Page
313 </h1>
314 <h2>NAME</h2>
315 <div class="sectionbody">
316 <p>git-show -
317 Show various types of objects
318 </p>
319 </div>
320 </div>
321 <h2>SYNOPSIS</h2>
322 <div class="sectionbody">
323 <div class="para"><p><em>git show</em> [options] &lt;object&gt;&#8230;</p></div>
324 </div>
325 <h2 id="_description">DESCRIPTION</h2>
326 <div class="sectionbody">
327 <div class="para"><p>Shows one or more objects (blobs, trees, tags and commits).</p></div>
328 <div class="para"><p>For commits it shows the log message and textual diff. It also
329 presents the merge commit in a special format as produced by
330 <em>git diff-tree --cc</em>.</p></div>
331 <div class="para"><p>For tags, it shows the tag message and the referenced objects.</p></div>
332 <div class="para"><p>For trees, it shows the names (equivalent to <em>git ls-tree</em>
333 with --name-only).</p></div>
334 <div class="para"><p>For plain blobs, it shows the plain contents.</p></div>
335 <div class="para"><p>The command takes options applicable to the <em>git diff-tree</em> command to
336 control how the changes the commit introduces are shown.</p></div>
337 <div class="para"><p>This manual page describes only the most frequently used options.</p></div>
338 </div>
339 <h2 id="_options">OPTIONS</h2>
340 <div class="sectionbody">
341 <div class="vlist"><dl>
342 <dt>
343 &lt;object&gt;&#8230;
344 </dt>
345 <dd>
347 The names of objects to show.
348 For a more complete list of ways to spell object names, see
349 "SPECIFYING REVISIONS" section in <a href="gitrevisions.html">gitrevisions(1)</a>.
350 </p>
351 </dd>
352 <dt>
353 --pretty[=<em>&lt;format&gt;</em>]
354 </dt>
355 <dt>
356 --format=<em>&lt;format&gt;</em>
357 </dt>
358 <dd>
360 Pretty-print the contents of the commit logs in a given format,
361 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
362 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>. See
363 the "PRETTY FORMATS" section for some additional details for each
364 format. When omitted, the format defaults to <em>medium</em>.
365 </p>
366 <div class="para"><p>Note: you can specify the default pretty format in the repository
367 configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
368 </dd>
369 <dt>
370 --abbrev-commit
371 </dt>
372 <dd>
374 Instead of showing the full 40-byte hexadecimal commit object
375 name, show only a partial prefix. Non default number of
376 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
377 diff output, if it is displayed).
378 </p>
379 <div class="para"><p>This should make "--pretty=oneline" a whole lot more readable for
380 people using 80-column terminals.</p></div>
381 </dd>
382 <dt>
383 --oneline
384 </dt>
385 <dd>
387 This is a shorthand for "--pretty=oneline --abbrev-commit"
388 used together.
389 </p>
390 </dd>
391 <dt>
392 --encoding[=&lt;encoding&gt;]
393 </dt>
394 <dd>
396 The commit objects record the encoding used for the log message
397 in their encoding header; this option can be used to tell the
398 command to re-code the commit log message in the encoding
399 preferred by the user. For non plumbing commands this
400 defaults to UTF-8.
401 </p>
402 </dd>
403 <dt>
404 --no-notes
405 </dt>
406 <dt>
407 --show-notes[=&lt;ref&gt;]
408 </dt>
409 <dd>
411 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
412 commit, when showing the commit log message. This is the default
413 for <tt>git log</tt>, <tt>git show</tt> and <tt>git whatchanged</tt> commands when
414 there is no <tt>--pretty</tt>, <tt>--format</tt> nor <tt>--oneline</tt> option is
415 given on the command line.
416 </p>
417 <div class="para"><p>With an optional argument, add this ref to the list of notes. The ref
418 is taken to be in <tt>refs/notes/</tt> if it is not qualified.</p></div>
419 </dd>
420 <dt>
421 --[no-]standard-notes
422 </dt>
423 <dd>
425 Enable or disable populating the notes ref list from the
426 <em>core.notesRef</em> and <em>notes.displayRef</em> variables (or
427 corresponding environment overrides). Enabled by default.
428 See <a href="git-config.html">git-config(1)</a>.
429 </p>
430 </dd>
431 </dl></div>
432 </div>
433 <h2 id="_pretty_formats">PRETTY FORMATS</h2>
434 <div class="sectionbody">
435 <div class="para"><p>If the commit is a merge, and if the pretty-format
436 is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
437 inserted before the <em>Author:</em> line. This line begins with
438 "Merge: " and the sha1s of ancestral commits are printed,
439 separated by spaces. Note that the listed commits may not
440 necessarily be the list of the <strong>direct</strong> parent commits if you
441 have limited your view of history: for example, if you are
442 only interested in changes related to a certain directory or
443 file.</p></div>
444 <div class="para"><p>There are several built-in formats, and you can define
445 additional formats by setting a pretty.&lt;name&gt;
446 config option to either another format name, or a
447 <em>format:</em> string, as described below (see
448 <a href="git-config.html">git-config(1)</a>). Here are the details of the
449 built-in formats:</p></div>
450 <div class="ilist"><ul>
451 <li>
453 <em>oneline</em>
454 </p>
455 <div class="literalblock">
456 <div class="content">
457 <pre><tt>&lt;sha1&gt; &lt;title line&gt;</tt></pre>
458 </div></div>
459 <div class="para"><p>This is designed to be as compact as possible.</p></div>
460 </li>
461 <li>
463 <em>short</em>
464 </p>
465 <div class="literalblock">
466 <div class="content">
467 <pre><tt>commit &lt;sha1&gt;
468 Author: &lt;author&gt;</tt></pre>
469 </div></div>
470 <div class="literalblock">
471 <div class="content">
472 <pre><tt>&lt;title line&gt;</tt></pre>
473 </div></div>
474 </li>
475 <li>
477 <em>medium</em>
478 </p>
479 <div class="literalblock">
480 <div class="content">
481 <pre><tt>commit &lt;sha1&gt;
482 Author: &lt;author&gt;
483 Date: &lt;author date&gt;</tt></pre>
484 </div></div>
485 <div class="literalblock">
486 <div class="content">
487 <pre><tt>&lt;title line&gt;</tt></pre>
488 </div></div>
489 <div class="literalblock">
490 <div class="content">
491 <pre><tt>&lt;full commit message&gt;</tt></pre>
492 </div></div>
493 </li>
494 <li>
496 <em>full</em>
497 </p>
498 <div class="literalblock">
499 <div class="content">
500 <pre><tt>commit &lt;sha1&gt;
501 Author: &lt;author&gt;
502 Commit: &lt;committer&gt;</tt></pre>
503 </div></div>
504 <div class="literalblock">
505 <div class="content">
506 <pre><tt>&lt;title line&gt;</tt></pre>
507 </div></div>
508 <div class="literalblock">
509 <div class="content">
510 <pre><tt>&lt;full commit message&gt;</tt></pre>
511 </div></div>
512 </li>
513 <li>
515 <em>fuller</em>
516 </p>
517 <div class="literalblock">
518 <div class="content">
519 <pre><tt>commit &lt;sha1&gt;
520 Author: &lt;author&gt;
521 AuthorDate: &lt;author date&gt;
522 Commit: &lt;committer&gt;
523 CommitDate: &lt;committer date&gt;</tt></pre>
524 </div></div>
525 <div class="literalblock">
526 <div class="content">
527 <pre><tt>&lt;title line&gt;</tt></pre>
528 </div></div>
529 <div class="literalblock">
530 <div class="content">
531 <pre><tt>&lt;full commit message&gt;</tt></pre>
532 </div></div>
533 </li>
534 <li>
536 <em>email</em>
537 </p>
538 <div class="literalblock">
539 <div class="content">
540 <pre><tt>From &lt;sha1&gt; &lt;date&gt;
541 From: &lt;author&gt;
542 Date: &lt;author date&gt;
543 Subject: [PATCH] &lt;title line&gt;</tt></pre>
544 </div></div>
545 <div class="literalblock">
546 <div class="content">
547 <pre><tt>&lt;full commit message&gt;</tt></pre>
548 </div></div>
549 </li>
550 <li>
552 <em>raw</em>
553 </p>
554 <div class="para"><p>The <em>raw</em> format shows the entire commit exactly as
555 stored in the commit object. Notably, the SHA1s are
556 displayed in full, regardless of whether --abbrev or
557 --no-abbrev are used, and <em>parents</em> information show the
558 true parent commits, without taking grafts nor history
559 simplification into account.</p></div>
560 </li>
561 <li>
563 <em>format:&lt;string&gt;</em>
564 </p>
565 <div class="para"><p>The <em>format:&lt;string&gt;</em> format allows you to specify which information
566 you want to show. It works a little bit like printf format,
567 with the notable exception that you get a newline with <em>%n</em>
568 instead of <em>\n</em>.</p></div>
569 <div class="para"><p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</em>
570 would show something like this:</p></div>
571 <div class="listingblock">
572 <div class="content">
573 <pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago
574 The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;
575 </tt></pre>
576 </div></div>
577 <div class="para"><p>The placeholders are:</p></div>
578 <div class="ilist"><ul>
579 <li>
581 <em>%H</em>: commit hash
582 </p>
583 </li>
584 <li>
586 <em>%h</em>: abbreviated commit hash
587 </p>
588 </li>
589 <li>
591 <em>%T</em>: tree hash
592 </p>
593 </li>
594 <li>
596 <em>%t</em>: abbreviated tree hash
597 </p>
598 </li>
599 <li>
601 <em>%P</em>: parent hashes
602 </p>
603 </li>
604 <li>
606 <em>%p</em>: abbreviated parent hashes
607 </p>
608 </li>
609 <li>
611 <em>%an</em>: author name
612 </p>
613 </li>
614 <li>
616 <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>)
617 </p>
618 </li>
619 <li>
621 <em>%ae</em>: author email
622 </p>
623 </li>
624 <li>
626 <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>)
627 </p>
628 </li>
629 <li>
631 <em>%ad</em>: author date (format respects --date= option)
632 </p>
633 </li>
634 <li>
636 <em>%aD</em>: author date, RFC2822 style
637 </p>
638 </li>
639 <li>
641 <em>%ar</em>: author date, relative
642 </p>
643 </li>
644 <li>
646 <em>%at</em>: author date, UNIX timestamp
647 </p>
648 </li>
649 <li>
651 <em>%ai</em>: author date, ISO 8601 format
652 </p>
653 </li>
654 <li>
656 <em>%cn</em>: committer name
657 </p>
658 </li>
659 <li>
661 <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>)
662 </p>
663 </li>
664 <li>
666 <em>%ce</em>: committer email
667 </p>
668 </li>
669 <li>
671 <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>)
672 </p>
673 </li>
674 <li>
676 <em>%cd</em>: committer date
677 </p>
678 </li>
679 <li>
681 <em>%cD</em>: committer date, RFC2822 style
682 </p>
683 </li>
684 <li>
686 <em>%cr</em>: committer date, relative
687 </p>
688 </li>
689 <li>
691 <em>%ct</em>: committer date, UNIX timestamp
692 </p>
693 </li>
694 <li>
696 <em>%ci</em>: committer date, ISO 8601 format
697 </p>
698 </li>
699 <li>
701 <em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
702 </p>
703 </li>
704 <li>
706 <em>%e</em>: encoding
707 </p>
708 </li>
709 <li>
711 <em>%s</em>: subject
712 </p>
713 </li>
714 <li>
716 <em>%f</em>: sanitized subject line, suitable for a filename
717 </p>
718 </li>
719 <li>
721 <em>%b</em>: body
722 </p>
723 </li>
724 <li>
726 <em>%B</em>: raw body (unwrapped subject and body)
727 </p>
728 </li>
729 <li>
731 <em>%N</em>: commit notes
732 </p>
733 </li>
734 <li>
736 <em>%gD</em>: reflog selector, e.g., <tt>refs/stash@{1}</tt>
737 </p>
738 </li>
739 <li>
741 <em>%gd</em>: shortened reflog selector, e.g., <tt>stash@{1}</tt>
742 </p>
743 </li>
744 <li>
746 <em>%gs</em>: reflog subject
747 </p>
748 </li>
749 <li>
751 <em>%Cred</em>: switch color to red
752 </p>
753 </li>
754 <li>
756 <em>%Cgreen</em>: switch color to green
757 </p>
758 </li>
759 <li>
761 <em>%Cblue</em>: switch color to blue
762 </p>
763 </li>
764 <li>
766 <em>%Creset</em>: reset color
767 </p>
768 </li>
769 <li>
771 <em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option
772 </p>
773 </li>
774 <li>
776 <em>%m</em>: left, right or boundary mark
777 </p>
778 </li>
779 <li>
781 <em>%n</em>: newline
782 </p>
783 </li>
784 <li>
786 <em>%%</em>: a raw <em>%</em>
787 </p>
788 </li>
789 <li>
791 <em>%x00</em>: print a byte from a hex code
792 </p>
793 </li>
794 <li>
796 <em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>: switch line wrapping, like the -w option of
797 <a href="git-shortlog.html">git-shortlog(1)</a>.
798 </p>
799 </li>
800 </ul></div>
801 </li>
802 </ul></div>
803 <div class="admonitionblock">
804 <table><tr>
805 <td class="icon">
806 <div class="title">Note</div>
807 </td>
808 <td class="content">Some placeholders may depend on other options given to the
809 revision traversal engine. For example, the <tt>%g*</tt> reflog options will
810 insert an empty string unless we are traversing reflog entries (e.g., by
811 <tt>git log -g</tt>). The <tt>%d</tt> placeholder will use the "short" decoration
812 format if <tt>--decorate</tt> was not already provided on the command line.</td>
813 </tr></table>
814 </div>
815 <div class="para"><p>If you add a <tt>&#43;</tt> (plus sign) after <em>%</em> of a placeholder, a line-feed
816 is inserted immediately before the expansion if and only if the
817 placeholder expands to a non-empty string.</p></div>
818 <div class="para"><p>If you add a <tt>-</tt> (minus sign) after <em>%</em> of a placeholder, line-feeds that
819 immediately precede the expansion are deleted if and only if the
820 placeholder expands to an empty string.</p></div>
821 <div class="para"><p>If you add a <tt> </tt> (space) after <em>%</em> of a placeholder, a space
822 is inserted immediately before the expansion if and only if the
823 placeholder expands to a non-empty string.</p></div>
824 <div class="ilist"><ul>
825 <li>
827 <em>tformat:</em>
828 </p>
829 <div class="para"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
830 provides "terminator" semantics instead of "separator" semantics. In
831 other words, each commit has the message terminator character (usually a
832 newline) appended, rather than a separator placed between entries.
833 This means that the final entry of a single-line format will be properly
834 terminated with a new line, just as the "oneline" format does.
835 For example:</p></div>
836 <div class="listingblock">
837 <div class="content">
838 <pre><tt>$ git log -2 --pretty=format:%h 4da45bef \
839 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
840 4da45be
841 7134973 -- NO NEWLINE
843 $ git log -2 --pretty=tformat:%h 4da45bef \
844 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
845 4da45be
846 7134973</tt></pre>
847 </div></div>
848 <div class="para"><p>In addition, any unrecognized string that has a <tt>%</tt> in it is interpreted
849 as if it has <tt>tformat:</tt> in front of it. For example, these two are
850 equivalent:</p></div>
851 <div class="listingblock">
852 <div class="content">
853 <pre><tt>$ git log -2 --pretty=tformat:%h 4da45bef
854 $ git log -2 --pretty=%h 4da45bef</tt></pre>
855 </div></div>
856 </li>
857 </ul></div>
858 </div>
859 <h2 id="_examples">EXAMPLES</h2>
860 <div class="sectionbody">
861 <div class="vlist"><dl>
862 <dt>
863 git show v1.0.0
864 </dt>
865 <dd>
867 Shows the tag <tt>v1.0.0</tt>, along with the object the tags
868 points at.
869 </p>
870 </dd>
871 <dt>
872 git show v1.0.0^{tree}
873 </dt>
874 <dd>
876 Shows the tree pointed to by the tag <tt>v1.0.0</tt>.
877 </p>
878 </dd>
879 <dt>
880 git show next~10:Documentation/README
881 </dt>
882 <dd>
884 Shows the contents of the file <tt>Documentation/README</tt> as
885 they were current in the 10th last commit of the branch
886 <tt>next</tt>.
887 </p>
888 </dd>
889 <dt>
890 git show master:Makefile master:t/Makefile
891 </dt>
892 <dd>
894 Concatenates the contents of said Makefiles in the head
895 of the branch <tt>master</tt>.
896 </p>
897 </dd>
898 </dl></div>
899 </div>
900 <h2 id="_discussion">Discussion</h2>
901 <div class="sectionbody">
902 <div class="para"><p>At the core level, git is character encoding agnostic.</p></div>
903 <div class="ilist"><ul>
904 <li>
906 The pathnames recorded in the index and in the tree objects
907 are treated as uninterpreted sequences of non-NUL bytes.
908 What readdir(2) returns are what are recorded and compared
909 with the data git keeps track of, which in turn are expected
910 to be what lstat(2) and creat(2) accepts. There is no such
911 thing as pathname encoding translation.
912 </p>
913 </li>
914 <li>
916 The contents of the blob objects are uninterpreted sequences
917 of bytes. There is no encoding translation at the core
918 level.
919 </p>
920 </li>
921 <li>
923 The commit log messages are uninterpreted sequences of non-NUL
924 bytes.
925 </p>
926 </li>
927 </ul></div>
928 <div class="para"><p>Although we encourage that the commit log messages are encoded
929 in UTF-8, both the core and git Porcelain are designed not to
930 force UTF-8 on projects. If all participants of a particular
931 project find it more convenient to use legacy encodings, git
932 does not forbid it. However, there are a few things to keep in
933 mind.</p></div>
934 <div class="olist"><ol>
935 <li>
937 <em>git commit</em> and <em>git commit-tree</em> issues
938 a warning if the commit log message given to it does not look
939 like a valid UTF-8 string, unless you explicitly say your
940 project uses a legacy encoding. The way to say this is to
941 have i18n.commitencoding in <tt>.git/config</tt> file, like this:
942 </p>
943 <div class="listingblock">
944 <div class="content">
945 <pre><tt>[i18n]
946 commitencoding = ISO-8859-1</tt></pre>
947 </div></div>
948 <div class="para"><p>Commit objects created with the above setting record the value
949 of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to
950 help other people who look at them later. Lack of this header
951 implies that the commit log message is encoded in UTF-8.</p></div>
952 </li>
953 <li>
955 <em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
956 <tt>encoding</tt> header of a commit object, and try to re-code the
957 log message into UTF-8 unless otherwise specified. You can
958 specify the desired output encoding with
959 <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this:
960 </p>
961 <div class="listingblock">
962 <div class="content">
963 <pre><tt>[i18n]
964 logoutputencoding = ISO-8859-1</tt></pre>
965 </div></div>
966 <div class="para"><p>If you do not have this configuration variable, the value of
967 <tt>i18n.commitencoding</tt> is used instead.</p></div>
968 </li>
969 </ol></div>
970 <div class="para"><p>Note that we deliberately chose not to re-code the commit log
971 message when a commit is made to force UTF-8 at the commit
972 object level, because re-coding to UTF-8 is not necessarily a
973 reversible operation.</p></div>
974 </div>
975 <h2 id="_author">Author</h2>
976 <div class="sectionbody">
977 <div class="para"><p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt; and
978 Junio C Hamano &lt;gitster@pobox.com&gt;. Significantly enhanced by
979 Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;.</p></div>
980 </div>
981 <h2 id="_documentation">Documentation</h2>
982 <div class="sectionbody">
983 <div class="para"><p>Documentation by David Greaves, Petr Baudis and the git-list &lt;git@vger.kernel.org&gt;.</p></div>
984 </div>
985 <h2 id="_git">GIT</h2>
986 <div class="sectionbody">
987 <div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
988 </div>
989 <div id="footer">
990 <div id="footer-text">
991 Last updated 2010-09-03 21:30:32 UTC
992 </div>
993 </div>
994 </body>
995 </html>