blob: 53b0daee2b9dca0b752c9f9942caa316c3aa1222 [file] [log] [blame]
Junio C Hamanod9d71c02006-02-08 00:52:331<!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 Hamanoba4b9282008-07-06 05:20:316<meta name="generator" content="AsciiDoc 8.2.5" />
Junio C Hamanod9d71c02006-02-08 00:52:337<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
Junio C Hamanoba4b9282008-07-06 05:20:3119a {
20 color: blue;
21 text-decoration: underline;
22}
23a:visited {
24 color: fuchsia;
25}
Junio C Hamanod9d71c02006-02-08 00:52:3326
27em {
28 font-style: italic;
29}
30
31strong {
32 font-weight: bold;
33}
34
35tt {
36 color: navy;
37}
38
39h1, 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;
45}
46
Junio C Hamanoba4b9282008-07-06 05:20:3147h1, h2, h3 {
Junio C Hamanod9d71c02006-02-08 00:52:3348 border-bottom: 2px solid silver;
49}
50h2 {
Junio C Hamanod9d71c02006-02-08 00:52:3351 padding-top: 0.5em;
52}
Junio C Hamanoba4b9282008-07-06 05:20:3153h3 {
54 float: left;
55}
56h3 + * {
57 clear: left;
58}
Junio C Hamanod9d71c02006-02-08 00:52:3359
60div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
63}
64
65hr {
66 border: 1px solid silver;
67}
68
69p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
72}
73
74pre {
75 padding: 0;
76 margin: 0;
77}
78
79span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3183 font-size: 1.1em;
Junio C Hamanod9d71c02006-02-08 00:52:3384}
85span#email {
86}
87span#revision {
88 font-family: sans-serif;
89}
90
91div#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;
97}
98div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
101}
102div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
105}
106
107div#preamble,
108div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
114}
115div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
118}
119
120div.content { /* Block element content. */
121 padding: 0;
122}
123
124/* Block element titles. */
125div.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;
131}
132div.title + * {
133 margin-top: 0;
134}
135
136td div.title:first-child {
137 margin-top: 0.0em;
138}
139div.content div.title:first-child {
140 margin-top: 0.0em;
141}
142div.content + div.title {
143 margin-top: 0.0em;
144}
145
146div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
150}
151
Junio C Hamanoba4b9282008-07-06 05:20:31152div.listingblock {
153 margin-right: 0%;
154}
Junio C Hamanod9d71c02006-02-08 00:52:33155div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
159}
160
161div.quoteblock > div.content {
162 padding-left: 2.0em;
163}
Junio C Hamanoba4b9282008-07-06 05:20:31164
165div.attribution {
Junio C Hamanod9d71c02006-02-08 00:52:33166 text-align: right;
167}
Junio C Hamanoba4b9282008-07-06 05:20:31168div.verseblock + div.attribution {
169 text-align: left;
170}
Junio C Hamanod9d71c02006-02-08 00:52:33171
172div.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;
179}
180div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
183}
184
185div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
188}
189
190div.verseblock div.content {
191 white-space: pre;
192}
193
194div.imageblock div.content { padding-left: 0; }
195div.imageblock img { border: 1px solid silver; }
196span.image img { border-style: none; }
197
198dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
201}
202dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
206}
207dd > *:first-child {
208 margin-top: 0;
209}
210
211ul, ol {
212 list-style-position: outside;
213}
Junio C Hamanoba4b9282008-07-06 05:20:31214div.olist2 ol {
Junio C Hamanod9d71c02006-02-08 00:52:33215 list-style-type: lower-alpha;
216}
217
218div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31219 border: 3px solid #527bbd;
Junio C Hamanod9d71c02006-02-08 00:52:33220}
221thead {
222 font-family: sans-serif;
223 font-weight: bold;
224}
225tfoot {
226 font-weight: bold;
227}
228
229div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
Junio C Hamanoba4b9282008-07-06 05:20:31233div.hlist td {
234 padding-bottom: 5px;
235}
Junio C Hamanod9d71c02006-02-08 00:52:33236td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
240}
241td.hlist2 {
242 vertical-align: top;
243}
244
245@media print {
246 div#footer-badges { display: none; }
247}
Junio C Hamanoba4b9282008-07-06 05:20:31248
249div#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;
256}
257
258div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
261}
262div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
265}
266div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
269}
270div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
273}
274include1::./stylesheets/xhtml11-manpage.css[]
Junio C Hamanod9d71c02006-02-08 00:52:33275/* Workarounds for IE6's broken and incomplete CSS2. */
276
277div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
281}
282div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
287}
288
289div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
293}
294
295div.quoteblock-content {
296 padding-left: 2.0em;
297}
298
299div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
302}
Junio C Hamanoba4b9282008-07-06 05:20:31303
304/* IE6 sets dynamically generated links as visited. */
305div#toc a:visited { color: blue; }
Junio C Hamanod9d71c02006-02-08 00:52:33306</style>
307<title>git-show(1)</title>
308</head>
309<body>
310<div id="header">
311<h1>
312git-show(1) Manual Page
313</h1>
314<h2>NAME</h2>
315<div class="sectionbody">
316<p>git-show -
Junio C Hamano7d23f5e2006-12-16 07:44:04317 Show various types of objects
Junio C Hamanod9d71c02006-02-08 00:52:33318</p>
319</div>
320</div>
321<h2>SYNOPSIS</h2>
322<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31323<div class="para"><p><em>git show</em> [options] &lt;object&gt;&#8230;</p></div>
Junio C Hamanod9d71c02006-02-08 00:52:33324</div>
Junio C Hamanoba4b9282008-07-06 05:20:31325<h2 id="_description">DESCRIPTION</h2>
Junio C Hamanod9d71c02006-02-08 00:52:33326<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31327<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
Junio C Hamano7d23f5e2006-12-16 07:44:04329presents the merge commit in a special format as produced by
Junio C Hamanoba4b9282008-07-06 05:20:31330<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>
333with --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
336control 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>
Junio C Hamanod9d71c02006-02-08 00:52:33338</div>
Junio C Hamanoba4b9282008-07-06 05:20:31339<h2 id="_options">OPTIONS</h2>
Junio C Hamanod9d71c02006-02-08 00:52:33340<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31341<div class="vlist"><dl>
Junio C Hamanod9d71c02006-02-08 00:52:33342<dt>
Junio C Hamano9e395072008-07-31 22:11:21343&lt;object&gt;&#8230;
Junio C Hamanod9d71c02006-02-08 00:52:33344</dt>
345<dd>
346<p>
Junio C Hamano9e395072008-07-31 22:11:21347 The names of objects to show.
Junio C Hamano2d47c622007-01-18 06:24:10348 For a more complete list of ways to spell object names, see
349 "SPECIFYING REVISIONS" section in <a href="git-rev-parse.html">git-rev-parse(1)</a>.
Junio C Hamanod9d71c02006-02-08 00:52:33350</p>
351</dd>
352<dt>
Junio C Hamanoa340aaa2006-11-23 02:47:33353--pretty[=<em>&lt;format&gt;</em>]
Junio C Hamanod9d71c02006-02-08 00:52:33354</dt>
355<dd>
356<p>
Junio C Hamanoa3770f92007-07-25 08:53:33357 Pretty-print the contents of the commit logs in a given format,
Junio C Hamano0430e3a2007-05-15 03:13:17358 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
359 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>.
Junio C Hamanoa3770f92007-07-25 08:53:33360 When omitted, the format defaults to <em>medium</em>.
Junio C Hamanod9d71c02006-02-08 00:52:33361</p>
Junio C Hamanoba4b9282008-07-06 05:20:31362<div class="para"><p>Note: you can specify the default pretty format in the repository
363configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:17364</dd>
365<dt>
Junio C Hamanoee695f22007-06-21 00:35:36366--abbrev-commit
367</dt>
368<dd>
369<p>
370 Instead of showing the full 40-byte hexadecimal commit object
371 name, show only handful hexdigits prefix. Non default number of
372 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
373 diff output, if it is displayed).
374</p>
Junio C Hamanoba4b9282008-07-06 05:20:31375<div class="para"><p>This should make "--pretty=oneline" a whole lot more readable for
376people using 80-column terminals.</p></div>
Junio C Hamanoee695f22007-06-21 00:35:36377</dd>
378<dt>
Junio C Hamano0430e3a2007-05-15 03:13:17379--encoding[=&lt;encoding&gt;]
380</dt>
381<dd>
382<p>
383 The commit objects record the encoding used for the log message
384 in their encoding header; this option can be used to tell the
385 command to re-code the commit log message in the encoding
386 preferred by the user. For non plumbing commands this
387 defaults to UTF-8.
388</p>
389</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31390</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:17391</div>
Junio C Hamanoba4b9282008-07-06 05:20:31392<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:17393<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31394<div class="para"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:17395is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
396inserted before the <em>Author:</em> line. This line begins with
397"Merge: " and the sha1s of ancestral commits are printed,
398separated by spaces. Note that the listed commits may not
399necessarily be the list of the <strong>direct</strong> parent commits if you
400have limited your view of history: for example, if you are
401only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:31402file.</p></div>
403<div class="para"><p>Here are some additional details for each format:</p></div>
404<div class="ilist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:33405<li>
406<p>
407<em>oneline</em>
408</p>
409<div class="literalblock">
410<div class="content">
411<pre><tt>&lt;sha1&gt; &lt;title line&gt;</tt></pre>
412</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:31413<div class="para"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:33414</li>
415<li>
416<p>
417<em>short</em>
418</p>
419<div class="literalblock">
420<div class="content">
421<pre><tt>commit &lt;sha1&gt;
422Author: &lt;author&gt;</tt></pre>
423</div></div>
424<div class="literalblock">
425<div class="content">
426<pre><tt>&lt;title line&gt;</tt></pre>
427</div></div>
428</li>
429<li>
430<p>
431<em>medium</em>
432</p>
433<div class="literalblock">
434<div class="content">
435<pre><tt>commit &lt;sha1&gt;
436Author: &lt;author&gt;
Junio C Hamano6a3c8272008-12-19 21:38:18437Date: &lt;author date&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33438</div></div>
439<div class="literalblock">
440<div class="content">
441<pre><tt>&lt;title line&gt;</tt></pre>
442</div></div>
443<div class="literalblock">
444<div class="content">
445<pre><tt>&lt;full commit message&gt;</tt></pre>
446</div></div>
447</li>
448<li>
449<p>
450<em>full</em>
451</p>
452<div class="literalblock">
453<div class="content">
454<pre><tt>commit &lt;sha1&gt;
455Author: &lt;author&gt;
456Commit: &lt;committer&gt;</tt></pre>
457</div></div>
458<div class="literalblock">
459<div class="content">
460<pre><tt>&lt;title line&gt;</tt></pre>
461</div></div>
462<div class="literalblock">
463<div class="content">
464<pre><tt>&lt;full commit message&gt;</tt></pre>
465</div></div>
466</li>
467<li>
468<p>
469<em>fuller</em>
470</p>
471<div class="literalblock">
472<div class="content">
473<pre><tt>commit &lt;sha1&gt;
Junio C Hamano6a3c8272008-12-19 21:38:18474Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:31475AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:18476Commit: &lt;committer&gt;
Junio C Hamanoba4b9282008-07-06 05:20:31477CommitDate: &lt;committer date&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33478</div></div>
479<div class="literalblock">
480<div class="content">
481<pre><tt>&lt;title line&gt;</tt></pre>
482</div></div>
483<div class="literalblock">
484<div class="content">
485<pre><tt>&lt;full commit message&gt;</tt></pre>
486</div></div>
487</li>
488<li>
489<p>
490<em>email</em>
491</p>
492<div class="literalblock">
493<div class="content">
494<pre><tt>From &lt;sha1&gt; &lt;date&gt;
495From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:31496Date: &lt;author date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:33497Subject: [PATCH] &lt;title line&gt;</tt></pre>
498</div></div>
499<div class="literalblock">
500<div class="content">
Junio C Hamano0430e3a2007-05-15 03:13:17501<pre><tt>&lt;full commit message&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33502</div></div>
503</li>
504<li>
505<p>
506<em>raw</em>
507</p>
Junio C Hamanoba4b9282008-07-06 05:20:31508<div class="para"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanoa340aaa2006-11-23 02:47:33509stored in the commit object. Notably, the SHA1s are
510displayed in full, regardless of whether --abbrev or
511--no-abbrev are used, and <em>parents</em> information show the
512true parent commits, without taking grafts nor history
Junio C Hamanoba4b9282008-07-06 05:20:31513simplification into account.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:33514</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:36515<li>
516<p>
517<em>format:</em>
518</p>
Junio C Hamanoba4b9282008-07-06 05:20:31519<div class="para"><p>The <em>format:</em> format allows you to specify which information
Junio C Hamanoa3fd83c2007-03-02 10:34:36520you want to show. It works a little bit like printf format,
521with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:31522instead of <em>\n</em>.</p></div>
523<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>
524would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:17525<div class="listingblock">
526<div class="content">
527<pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago
528The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;
529</tt></pre>
530</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:31531<div class="para"><p>The placeholders are:</p></div>
532<div class="ilist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:36533<li>
534<p>
535<em>%H</em>: commit hash
536</p>
537</li>
538<li>
539<p>
540<em>%h</em>: abbreviated commit hash
541</p>
542</li>
543<li>
544<p>
545<em>%T</em>: tree hash
546</p>
547</li>
548<li>
549<p>
550<em>%t</em>: abbreviated tree hash
551</p>
552</li>
553<li>
554<p>
555<em>%P</em>: parent hashes
556</p>
557</li>
558<li>
559<p>
560<em>%p</em>: abbreviated parent hashes
561</p>
562</li>
563<li>
564<p>
565<em>%an</em>: author name
566</p>
567</li>
568<li>
569<p>
Junio C Hamanof5a93622008-07-16 03:23:57570<em>%aN</em>: author name (respecting .mailmap)
571</p>
572</li>
573<li>
574<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36575<em>%ae</em>: author email
576</p>
577</li>
578<li>
579<p>
Junio C Hamanoa387df32008-08-29 08:56:58580<em>%ad</em>: author date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:36581</p>
582</li>
583<li>
584<p>
585<em>%aD</em>: author date, RFC2822 style
586</p>
587</li>
588<li>
589<p>
590<em>%ar</em>: author date, relative
591</p>
592</li>
593<li>
594<p>
595<em>%at</em>: author date, UNIX timestamp
596</p>
597</li>
598<li>
599<p>
Junio C Hamano02f130b2007-07-14 08:26:56600<em>%ai</em>: author date, ISO 8601 format
601</p>
602</li>
603<li>
604<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36605<em>%cn</em>: committer name
606</p>
607</li>
608<li>
609<p>
Junio C Hamanof5a93622008-07-16 03:23:57610<em>%cN</em>: committer name (respecting .mailmap)
611</p>
612</li>
613<li>
614<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36615<em>%ce</em>: committer email
616</p>
617</li>
618<li>
619<p>
620<em>%cd</em>: committer date
621</p>
622</li>
623<li>
624<p>
625<em>%cD</em>: committer date, RFC2822 style
626</p>
627</li>
628<li>
629<p>
630<em>%cr</em>: committer date, relative
631</p>
632</li>
633<li>
634<p>
635<em>%ct</em>: committer date, UNIX timestamp
636</p>
637</li>
638<li>
639<p>
Junio C Hamano02f130b2007-07-14 08:26:56640<em>%ci</em>: committer date, ISO 8601 format
641</p>
642</li>
643<li>
644<p>
Junio C Hamano5e4d8de2008-09-19 06:27:02645<em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
646</p>
647</li>
648<li>
649<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36650<em>%e</em>: encoding
651</p>
652</li>
653<li>
654<p>
655<em>%s</em>: subject
656</p>
657</li>
658<li>
659<p>
660<em>%b</em>: body
661</p>
662</li>
663<li>
664<p>
665<em>%Cred</em>: switch color to red
666</p>
667</li>
668<li>
669<p>
670<em>%Cgreen</em>: switch color to green
671</p>
672</li>
673<li>
674<p>
675<em>%Cblue</em>: switch color to blue
676</p>
677</li>
678<li>
679<p>
680<em>%Creset</em>: reset color
681</p>
682</li>
683<li>
684<p>
Junio C Hamanod9e0e5d2007-04-14 16:22:04685<em>%m</em>: left, right or boundary mark
686</p>
687</li>
688<li>
689<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36690<em>%n</em>: newline
691</p>
Junio C Hamano0430e3a2007-05-15 03:13:17692</li>
Junio C Hamanob78d2592008-04-09 09:39:08693<li>
694<p>
695<em>%x00</em>: print a byte from a hex code
696</p>
697</li>
Junio C Hamanoba4b9282008-07-06 05:20:31698</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:36699</li>
Junio C Hamano6fb124c2008-06-13 10:04:01700<li>
701<p>
702<em>tformat:</em>
703</p>
Junio C Hamanoba4b9282008-07-06 05:20:31704<div class="para"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
Junio C Hamano6fb124c2008-06-13 10:04:01705provides "terminator" semantics instead of "separator" semantics. In
706other words, each commit has the message terminator character (usually a
707newline) appended, rather than a separator placed between entries.
708This means that the final entry of a single-line format will be properly
709terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:31710For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:01711<div class="listingblock">
712<div class="content">
713<pre><tt>$ git log -2 --pretty=format:%h 4da45bef \
714 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
7154da45be
7167134973 -- NO NEWLINE
717
718$ git log -2 --pretty=tformat:%h 4da45bef \
719 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
7204da45be
7217134973</tt></pre>
722</div></div>
723</li>
Junio C Hamanoba4b9282008-07-06 05:20:31724</ul></div>
Junio C Hamanod9d71c02006-02-08 00:52:33725</div>
Junio C Hamanoba4b9282008-07-06 05:20:31726<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano7d23f5e2006-12-16 07:44:04727<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31728<div class="vlist"><dl>
Junio C Hamano7d23f5e2006-12-16 07:44:04729<dt>
730git show v1.0.0
731</dt>
732<dd>
733<p>
Junio C Hamano775a0f42006-12-31 01:19:14734 Shows the tag <tt>v1.0.0</tt>, along with the object the tags
735 points at.
Junio C Hamano7d23f5e2006-12-16 07:44:04736</p>
737</dd>
738<dt>
Junio C Hamanodb911ee2007-02-28 08:13:52739git show v1.0.0^{tree}
Junio C Hamano7d23f5e2006-12-16 07:44:04740</dt>
741<dd>
742<p>
743 Shows the tree pointed to by the tag <tt>v1.0.0</tt>.
744</p>
745</dd>
Junio C Hamanodb911ee2007-02-28 08:13:52746<dt>
747git show next~10:Documentation/README
748</dt>
749<dd>
750<p>
Junio C Hamano7d23f5e2006-12-16 07:44:04751 Shows the contents of the file <tt>Documentation/README</tt> as
752 they were current in the 10th last commit of the branch
Junio C Hamanodb911ee2007-02-28 08:13:52753 <tt>next</tt>.
754</p>
755</dd>
756<dt>
757git show master:Makefile master:t/Makefile
758</dt>
759<dd>
760<p>
Junio C Hamano7d23f5e2006-12-16 07:44:04761 Concatenates the contents of said Makefiles in the head
Junio C Hamanodb911ee2007-02-28 08:13:52762 of the branch <tt>master</tt>.
763</p>
764</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31765</dl></div>
Junio C Hamano7d23f5e2006-12-16 07:44:04766</div>
Junio C Hamanoba4b9282008-07-06 05:20:31767<h2 id="_discussion">Discussion</h2>
Junio C Hamano775a0f42006-12-31 01:19:14768<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31769<div class="para"><p>At the core level, git is character encoding agnostic.</p></div>
770<div class="ilist"><ul>
Junio C Hamano775a0f42006-12-31 01:19:14771<li>
772<p>
773The pathnames recorded in the index and in the tree objects
774 are treated as uninterpreted sequences of non-NUL bytes.
775 What readdir(2) returns are what are recorded and compared
776 with the data git keeps track of, which in turn are expected
777 to be what lstat(2) and creat(2) accepts. There is no such
778 thing as pathname encoding translation.
779</p>
780</li>
781<li>
782<p>
Junio C Hamano54bf1e22008-12-20 06:30:11783The contents of the blob objects are uninterpreted sequences
Junio C Hamano775a0f42006-12-31 01:19:14784 of bytes. There is no encoding translation at the core
785 level.
786</p>
787</li>
788<li>
789<p>
Junio C Hamano54bf1e22008-12-20 06:30:11790The commit log messages are uninterpreted sequences of non-NUL
Junio C Hamano775a0f42006-12-31 01:19:14791 bytes.
792</p>
793</li>
Junio C Hamanoba4b9282008-07-06 05:20:31794</ul></div>
795<div class="para"><p>Although we encourage that the commit log messages are encoded
Junio C Hamano775a0f42006-12-31 01:19:14796in UTF-8, both the core and git Porcelain are designed not to
797force UTF-8 on projects. If all participants of a particular
798project find it more convenient to use legacy encodings, git
799does not forbid it. However, there are a few things to keep in
Junio C Hamanoba4b9282008-07-06 05:20:31800mind.</p></div>
801<div class="olist"><ol>
Junio C Hamano775a0f42006-12-31 01:19:14802<li>
803<p>
Junio C Hamano37276192008-09-04 00:24:07804<em>git-commit</em> and <em>git-commit-tree</em> issues
Junio C Hamano14b76482008-01-05 10:32:26805 a warning if the commit log message given to it does not look
Junio C Hamano775a0f42006-12-31 01:19:14806 like a valid UTF-8 string, unless you explicitly say your
807 project uses a legacy encoding. The way to say this is to
Junio C Hamano35bb3f62007-02-19 05:35:53808 have i18n.commitencoding in <tt>.git/config</tt> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:14809</p>
810<div class="listingblock">
811<div class="content">
Junio C Hamano35bb3f62007-02-19 05:35:53812<pre><tt>[i18n]
Junio C Hamano775a0f42006-12-31 01:19:14813 commitencoding = ISO-8859-1</tt></pre>
814</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:31815<div class="para"><p>Commit objects created with the above setting record the value
Junio C Hamano35bb3f62007-02-19 05:35:53816of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to
Junio C Hamano775a0f42006-12-31 01:19:14817help other people who look at them later. Lack of this header
Junio C Hamanoba4b9282008-07-06 05:20:31818implies that the commit log message is encoded in UTF-8.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:14819</li>
820<li>
821<p>
Junio C Hamanoaa17c7c2008-11-03 04:36:58822<em>git-log</em>, <em>git-show</em>, <em>git-blame</em> and friends look at the
823 <tt>encoding</tt> header of a commit object, and try to re-code the
824 log message into UTF-8 unless otherwise specified. You can
Junio C Hamano775a0f42006-12-31 01:19:14825 specify the desired output encoding with
Junio C Hamano35bb3f62007-02-19 05:35:53826 <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:14827</p>
828<div class="listingblock">
829<div class="content">
Junio C Hamano35bb3f62007-02-19 05:35:53830<pre><tt>[i18n]
Junio C Hamano775a0f42006-12-31 01:19:14831 logoutputencoding = ISO-8859-1</tt></pre>
832</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:31833<div class="para"><p>If you do not have this configuration variable, the value of
834<tt>i18n.commitencoding</tt> is used instead.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:14835</li>
Junio C Hamanoba4b9282008-07-06 05:20:31836</ol></div>
837<div class="para"><p>Note that we deliberately chose not to re-code the commit log
Junio C Hamano775a0f42006-12-31 01:19:14838message when a commit is made to force UTF-8 at the commit
839object level, because re-coding to UTF-8 is not necessarily a
Junio C Hamanoba4b9282008-07-06 05:20:31840reversible operation.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:14841</div>
Junio C Hamanoba4b9282008-07-06 05:20:31842<h2 id="_author">Author</h2>
Junio C Hamanod9d71c02006-02-08 00:52:33843<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31844<div class="para"><p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt; and
Junio C Hamano0868a302008-07-22 09:20:44845Junio C Hamano &lt;gitster@pobox.com&gt;. Significantly enhanced by
Junio C Hamanoba4b9282008-07-06 05:20:31846Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;.</p></div>
Junio C Hamanod9d71c02006-02-08 00:52:33847</div>
Junio C Hamanoba4b9282008-07-06 05:20:31848<h2 id="_documentation">Documentation</h2>
Junio C Hamanod9d71c02006-02-08 00:52:33849<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31850<div class="para"><p>Documentation by David Greaves, Petr Baudis and the git-list &lt;git@vger.kernel.org&gt;.</p></div>
Junio C Hamanod9d71c02006-02-08 00:52:33851</div>
Junio C Hamanoba4b9282008-07-06 05:20:31852<h2 id="_git">GIT</h2>
Junio C Hamanod9d71c02006-02-08 00:52:33853<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31854<div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamanod9d71c02006-02-08 00:52:33855</div>
856<div id="footer">
857<div id="footer-text">
Junio C Hamano54bf1e22008-12-20 06:30:11858Last updated 2008-12-20 06:29:41 UTC
Junio C Hamanod9d71c02006-02-08 00:52:33859</div>
860</div>
861</body>
862</html>