Merge branch 'scintilla-365'
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / git-show.xml
blobb1865fa57a8cba6df93ce74afe4086c936431f9c
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE sect2 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">\r
3 \r
4 <sect2 lang="en" id="git-show(1)">\r
5     <title>git-show(1)</title>\r
6 <indexterm>\r
7 <primary>git-show(1)</primary>\r
8 </indexterm>\r
9 <simplesect id="git-show(1)__name">\r
10 <title>NAME</title>\r
11 <simpara>git-show - Show various types of objects</simpara>\r
12 </simplesect>\r
13 <simplesect id="git-show(1)__synopsis">\r
14 <title>SYNOPSIS</title>\r
15 <blockquote>\r
16 <literallayout><emphasis>git show</emphasis> [options] &lt;object&gt;&#8230;</literallayout>\r
17 </blockquote>\r
18 </simplesect>\r
19 <simplesect id="git-show(1)__description">\r
20 <title>DESCRIPTION</title>\r
21 <simpara>Shows one or more objects (blobs, trees, tags and commits).</simpara>\r
22 <simpara>For commits it shows the log message and textual diff. It also\r
23 presents the merge commit in a special format as produced by\r
24 <emphasis>git diff-tree --cc</emphasis>.</simpara>\r
25 <simpara>For tags, it shows the tag message and the referenced objects.</simpara>\r
26 <simpara>For trees, it shows the names (equivalent to <emphasis>git ls-tree</emphasis>\r
27 with --name-only).</simpara>\r
28 <simpara>For plain blobs, it shows the plain contents.</simpara>\r
29 <simpara>The command takes options applicable to the <emphasis>git diff-tree</emphasis> command to\r
30 control how the changes the commit introduces are shown.</simpara>\r
31 <simpara>This manual page describes only the most frequently used options.</simpara>\r
32 </simplesect>\r
33 <simplesect id="git-show(1)__options">\r
34 <title>OPTIONS</title>\r
35 <variablelist>\r
36 <varlistentry>\r
37 <term>\r
38 &lt;object&gt;&#8230;\r
39 </term>\r
40 <listitem>\r
41 <simpara>\r
42         The names of objects to show.\r
43         For a more complete list of ways to spell object names, see\r
44         "SPECIFYING REVISIONS" section in <xref linkend="gitrevisions(7)" />.\r
45 </simpara>\r
46 </listitem>\r
47 </varlistentry>\r
48 <varlistentry>\r
49 <term>\r
50 --pretty[=&lt;format&gt;]\r
51 </term>\r
52 <term>\r
53 --format=&lt;format&gt;\r
54 </term>\r
55 <listitem>\r
56 <simpara>\r
57         Pretty-print the contents of the commit logs in a given format,\r
58         where <emphasis>&lt;format&gt;</emphasis> can be one of <emphasis>oneline</emphasis>, <emphasis>short</emphasis>, <emphasis>medium</emphasis>,\r
59         <emphasis>full</emphasis>, <emphasis>fuller</emphasis>, <emphasis>email</emphasis>, <emphasis>raw</emphasis> and <emphasis>format:&lt;string&gt;</emphasis>.  See\r
60         the "PRETTY FORMATS" section for some additional details for each\r
61         format.  When omitted, the format defaults to <emphasis>medium</emphasis>.\r
62 </simpara>\r
63 <simpara>Note: you can specify the default pretty format in the repository\r
64 configuration (see <xref linkend="git-config(1)" />).</simpara>\r
65 </listitem>\r
66 </varlistentry>\r
67 <varlistentry>\r
68 <term>\r
69 --abbrev-commit\r
70 </term>\r
71 <listitem>\r
72 <simpara>\r
73         Instead of showing the full 40-byte hexadecimal commit object\r
74         name, show only a partial prefix.  Non default number of\r
75         digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies\r
76         diff output, if it is displayed).\r
77 </simpara>\r
78 <simpara>This should make "--pretty=oneline" a whole lot more readable for\r
79 people using 80-column terminals.</simpara>\r
80 </listitem>\r
81 </varlistentry>\r
82 <varlistentry>\r
83 <term>\r
84 --no-abbrev-commit\r
85 </term>\r
86 <listitem>\r
87 <simpara>\r
88         Show the full 40-byte hexadecimal commit object name. This negates\r
89         <emphasis>--abbrev-commit</emphasis> and those options which imply it such as\r
90         "--oneline". It also overrides the <emphasis>log.abbrevCommit</emphasis> variable.\r
91 </simpara>\r
92 </listitem>\r
93 </varlistentry>\r
94 <varlistentry>\r
95 <term>\r
96 --oneline\r
97 </term>\r
98 <listitem>\r
99 <simpara>\r
100         This is a shorthand for "--pretty=oneline --abbrev-commit"\r
101         used together.\r
102 </simpara>\r
103 </listitem>\r
104 </varlistentry>\r
105 <varlistentry>\r
106 <term>\r
107 --encoding[=&lt;encoding&gt;]\r
108 </term>\r
109 <listitem>\r
110 <simpara>\r
111         The commit objects record the encoding used for the log message\r
112         in their encoding header; this option can be used to tell the\r
113         command to re-code the commit log message in the encoding\r
114         preferred by the user.  For non plumbing commands this\r
115         defaults to UTF-8.\r
116 </simpara>\r
117 </listitem>\r
118 </varlistentry>\r
119 <varlistentry>\r
120 <term>\r
121 --notes[=&lt;ref&gt;]\r
122 </term>\r
123 <listitem>\r
124 <simpara>\r
125         Show the notes (see <xref linkend="git-notes(1)" />) that annotate the\r
126         commit, when showing the commit log message.  This is the default\r
127         for <emphasis>git log</emphasis>, <emphasis>git show</emphasis> and <emphasis>git whatchanged</emphasis> commands when\r
128         there is no <emphasis>--pretty</emphasis>, <emphasis>--format</emphasis> nor <emphasis>--oneline</emphasis> option given\r
129         on the command line.\r
130 </simpara>\r
131 <simpara>By default, the notes shown are from the notes refs listed in the\r
132 <emphasis>core.notesRef</emphasis> and <emphasis>notes.displayRef</emphasis> variables (or corresponding\r
133 environment overrides). See <xref linkend="git-config(1)" /> for more details.</simpara>\r
134 <simpara>With an optional <emphasis>&lt;ref&gt;</emphasis> argument, show this notes ref instead of the\r
135 default notes ref(s). The ref is taken to be in <emphasis>refs/notes/</emphasis> if it\r
136 is not qualified.</simpara>\r
137 <simpara>Multiple --notes options can be combined to control which notes are\r
138 being displayed. Examples: "--notes=foo" will show only notes from\r
139 "refs/notes/foo"; "--notes=foo --notes" will show both notes from\r
140 "refs/notes/foo" and from the default notes ref(s).</simpara>\r
141 </listitem>\r
142 </varlistentry>\r
143 <varlistentry>\r
144 <term>\r
145 --no-notes\r
146 </term>\r
147 <listitem>\r
148 <simpara>\r
149         Do not show notes. This negates the above <emphasis>--notes</emphasis> option, by\r
150         resetting the list of notes refs from which notes are shown.\r
151         Options are parsed in the order given on the command line, so e.g.\r
152         "--notes --notes=foo --no-notes --notes=bar" will only show notes\r
153         from "refs/notes/bar".\r
154 </simpara>\r
155 </listitem>\r
156 </varlistentry>\r
157 <varlistentry>\r
158 <term>\r
159 --show-notes[=&lt;ref&gt;]\r
160 </term>\r
161 <term>\r
162 --[no-]standard-notes\r
163 </term>\r
164 <listitem>\r
165 <simpara>\r
166         These options are deprecated. Use the above --notes/--no-notes\r
167         options instead.\r
168 </simpara>\r
169 </listitem>\r
170 </varlistentry>\r
171 <varlistentry>\r
172 <term>\r
173 --show-signature\r
174 </term>\r
175 <listitem>\r
176 <simpara>\r
177         Check the validity of a signed commit object by passing the signature\r
178         to <emphasis>gpg --verify</emphasis> and show the output.\r
179 </simpara>\r
180 </listitem>\r
181 </varlistentry>\r
182 </variablelist>\r
183 </simplesect>\r
184 <simplesect id="git-show(1)__pretty_formats">\r
185 <title>PRETTY FORMATS</title>\r
186 <simpara>If the commit is a merge, and if the pretty-format\r
187 is not <emphasis>oneline</emphasis>, <emphasis>email</emphasis> or <emphasis>raw</emphasis>, an additional line is\r
188 inserted before the <emphasis>Author:</emphasis> line.  This line begins with\r
189 "Merge: " and the sha1s of ancestral commits are printed,\r
190 separated by spaces.  Note that the listed commits may not\r
191 necessarily be the list of the <emphasis role="strong">direct</emphasis> parent commits if you\r
192 have limited your view of history: for example, if you are\r
193 only interested in changes related to a certain directory or\r
194 file.</simpara>\r
195 <simpara>There are several built-in formats, and you can define\r
196 additional formats by setting a pretty.&lt;name&gt;\r
197 config option to either another format name, or a\r
198 <emphasis>format:</emphasis> string, as described below (see\r
199 <xref linkend="git-config(1)" />). Here are the details of the\r
200 built-in formats:</simpara>\r
201 <itemizedlist>\r
202 <listitem>\r
203 <simpara>\r
204 <emphasis>oneline</emphasis>\r
205 </simpara>\r
206 <literallayout class="monospaced">&lt;sha1&gt; &lt;title line&gt;</literallayout>\r
207 <simpara>This is designed to be as compact as possible.</simpara>\r
208 </listitem>\r
209 <listitem>\r
210 <simpara>\r
211 <emphasis>short</emphasis>\r
212 </simpara>\r
213 <literallayout class="monospaced">commit &lt;sha1&gt;\r
214 Author: &lt;author&gt;</literallayout>\r
215 <literallayout class="monospaced">&lt;title line&gt;</literallayout>\r
216 </listitem>\r
217 <listitem>\r
218 <simpara>\r
219 <emphasis>medium</emphasis>\r
220 </simpara>\r
221 <literallayout class="monospaced">commit &lt;sha1&gt;\r
222 Author: &lt;author&gt;\r
223 Date:   &lt;author date&gt;</literallayout>\r
224 <literallayout class="monospaced">&lt;title line&gt;</literallayout>\r
225 <literallayout class="monospaced">&lt;full commit message&gt;</literallayout>\r
226 </listitem>\r
227 <listitem>\r
228 <simpara>\r
229 <emphasis>full</emphasis>\r
230 </simpara>\r
231 <literallayout class="monospaced">commit &lt;sha1&gt;\r
232 Author: &lt;author&gt;\r
233 Commit: &lt;committer&gt;</literallayout>\r
234 <literallayout class="monospaced">&lt;title line&gt;</literallayout>\r
235 <literallayout class="monospaced">&lt;full commit message&gt;</literallayout>\r
236 </listitem>\r
237 <listitem>\r
238 <simpara>\r
239 <emphasis>fuller</emphasis>\r
240 </simpara>\r
241 <literallayout class="monospaced">commit &lt;sha1&gt;\r
242 Author:     &lt;author&gt;\r
243 AuthorDate: &lt;author date&gt;\r
244 Commit:     &lt;committer&gt;\r
245 CommitDate: &lt;committer date&gt;</literallayout>\r
246 <literallayout class="monospaced">&lt;title line&gt;</literallayout>\r
247 <literallayout class="monospaced">&lt;full commit message&gt;</literallayout>\r
248 </listitem>\r
249 <listitem>\r
250 <simpara>\r
251 <emphasis>email</emphasis>\r
252 </simpara>\r
253 <literallayout class="monospaced">From &lt;sha1&gt; &lt;date&gt;\r
254 From: &lt;author&gt;\r
255 Date: &lt;author date&gt;\r
256 Subject: [PATCH] &lt;title line&gt;</literallayout>\r
257 <literallayout class="monospaced">&lt;full commit message&gt;</literallayout>\r
258 </listitem>\r
259 <listitem>\r
260 <simpara>\r
261 <emphasis>raw</emphasis>\r
262 </simpara>\r
263 <simpara>The <emphasis>raw</emphasis> format shows the entire commit exactly as\r
264 stored in the commit object.  Notably, the SHA1s are\r
265 displayed in full, regardless of whether --abbrev or\r
266 --no-abbrev are used, and <emphasis>parents</emphasis> information show the\r
267 true parent commits, without taking grafts nor history\r
268 simplification into account.</simpara>\r
269 </listitem>\r
270 <listitem>\r
271 <simpara>\r
272 <emphasis>format:&lt;string&gt;</emphasis>\r
273 </simpara>\r
274 <simpara>The <emphasis>format:&lt;string&gt;</emphasis> format allows you to specify which information\r
275 you want to show. It works a little bit like printf format,\r
276 with the notable exception that you get a newline with <emphasis>%n</emphasis>\r
277 instead of <emphasis>\n</emphasis>.</simpara>\r
278 <simpara>E.g, <emphasis>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</emphasis>\r
279 would show something like this:</simpara>\r
280 <screen>The author of fe6e0ee was Junio C Hamano, 23 hours ago\r
281 The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</screen>\r
282 <simpara>The placeholders are:</simpara>\r
283 <itemizedlist>\r
284 <listitem>\r
285 <simpara>\r
286 <emphasis>%H</emphasis>: commit hash\r
287 </simpara>\r
288 </listitem>\r
289 <listitem>\r
290 <simpara>\r
291 <emphasis>%h</emphasis>: abbreviated commit hash\r
292 </simpara>\r
293 </listitem>\r
294 <listitem>\r
295 <simpara>\r
296 <emphasis>%T</emphasis>: tree hash\r
297 </simpara>\r
298 </listitem>\r
299 <listitem>\r
300 <simpara>\r
301 <emphasis>%t</emphasis>: abbreviated tree hash\r
302 </simpara>\r
303 </listitem>\r
304 <listitem>\r
305 <simpara>\r
306 <emphasis>%P</emphasis>: parent hashes\r
307 </simpara>\r
308 </listitem>\r
309 <listitem>\r
310 <simpara>\r
311 <emphasis>%p</emphasis>: abbreviated parent hashes\r
312 </simpara>\r
313 </listitem>\r
314 <listitem>\r
315 <simpara>\r
316 <emphasis>%an</emphasis>: author name\r
317 </simpara>\r
318 </listitem>\r
319 <listitem>\r
320 <simpara>\r
321 <emphasis>%aN</emphasis>: author name (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
322 </simpara>\r
323 </listitem>\r
324 <listitem>\r
325 <simpara>\r
326 <emphasis>%ae</emphasis>: author email\r
327 </simpara>\r
328 </listitem>\r
329 <listitem>\r
330 <simpara>\r
331 <emphasis>%aE</emphasis>: author email (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
332 </simpara>\r
333 </listitem>\r
334 <listitem>\r
335 <simpara>\r
336 <emphasis>%ad</emphasis>: author date (format respects --date= option)\r
337 </simpara>\r
338 </listitem>\r
339 <listitem>\r
340 <simpara>\r
341 <emphasis>%aD</emphasis>: author date, RFC2822 style\r
342 </simpara>\r
343 </listitem>\r
344 <listitem>\r
345 <simpara>\r
346 <emphasis>%ar</emphasis>: author date, relative\r
347 </simpara>\r
348 </listitem>\r
349 <listitem>\r
350 <simpara>\r
351 <emphasis>%at</emphasis>: author date, UNIX timestamp\r
352 </simpara>\r
353 </listitem>\r
354 <listitem>\r
355 <simpara>\r
356 <emphasis>%ai</emphasis>: author date, ISO 8601 format\r
357 </simpara>\r
358 </listitem>\r
359 <listitem>\r
360 <simpara>\r
361 <emphasis>%cn</emphasis>: committer name\r
362 </simpara>\r
363 </listitem>\r
364 <listitem>\r
365 <simpara>\r
366 <emphasis>%cN</emphasis>: committer name (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
367 </simpara>\r
368 </listitem>\r
369 <listitem>\r
370 <simpara>\r
371 <emphasis>%ce</emphasis>: committer email\r
372 </simpara>\r
373 </listitem>\r
374 <listitem>\r
375 <simpara>\r
376 <emphasis>%cE</emphasis>: committer email (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
377 </simpara>\r
378 </listitem>\r
379 <listitem>\r
380 <simpara>\r
381 <emphasis>%cd</emphasis>: committer date\r
382 </simpara>\r
383 </listitem>\r
384 <listitem>\r
385 <simpara>\r
386 <emphasis>%cD</emphasis>: committer date, RFC2822 style\r
387 </simpara>\r
388 </listitem>\r
389 <listitem>\r
390 <simpara>\r
391 <emphasis>%cr</emphasis>: committer date, relative\r
392 </simpara>\r
393 </listitem>\r
394 <listitem>\r
395 <simpara>\r
396 <emphasis>%ct</emphasis>: committer date, UNIX timestamp\r
397 </simpara>\r
398 </listitem>\r
399 <listitem>\r
400 <simpara>\r
401 <emphasis>%ci</emphasis>: committer date, ISO 8601 format\r
402 </simpara>\r
403 </listitem>\r
404 <listitem>\r
405 <simpara>\r
406 <emphasis>%d</emphasis>: ref names, like the --decorate option of <xref linkend="git-log(1)" />\r
407 </simpara>\r
408 </listitem>\r
409 <listitem>\r
410 <simpara>\r
411 <emphasis>%e</emphasis>: encoding\r
412 </simpara>\r
413 </listitem>\r
414 <listitem>\r
415 <simpara>\r
416 <emphasis>%s</emphasis>: subject\r
417 </simpara>\r
418 </listitem>\r
419 <listitem>\r
420 <simpara>\r
421 <emphasis>%f</emphasis>: sanitized subject line, suitable for a filename\r
422 </simpara>\r
423 </listitem>\r
424 <listitem>\r
425 <simpara>\r
426 <emphasis>%b</emphasis>: body\r
427 </simpara>\r
428 </listitem>\r
429 <listitem>\r
430 <simpara>\r
431 <emphasis>%B</emphasis>: raw body (unwrapped subject and body)\r
432 </simpara>\r
433 </listitem>\r
434 <listitem>\r
435 <simpara>\r
436 <emphasis>%N</emphasis>: commit notes\r
437 </simpara>\r
438 </listitem>\r
439 <listitem>\r
440 <simpara>\r
441 <emphasis>%GG</emphasis>: raw verification message from GPG for a signed commit\r
442 </simpara>\r
443 </listitem>\r
444 <listitem>\r
445 <simpara>\r
446 <emphasis>%G?</emphasis>: show either "G" for Good or "B" for Bad for a signed commit\r
447 </simpara>\r
448 </listitem>\r
449 <listitem>\r
450 <simpara>\r
451 <emphasis>%GS</emphasis>: show the name of the signer for a signed commit\r
452 </simpara>\r
453 </listitem>\r
454 <listitem>\r
455 <simpara>\r
456 <emphasis>%gD</emphasis>: reflog selector, e.g., <emphasis>refs/stash@{1}</emphasis>\r
457 </simpara>\r
458 </listitem>\r
459 <listitem>\r
460 <simpara>\r
461 <emphasis>%gd</emphasis>: shortened reflog selector, e.g., <emphasis>stash@{1}</emphasis>\r
462 </simpara>\r
463 </listitem>\r
464 <listitem>\r
465 <simpara>\r
466 <emphasis>%gn</emphasis>: reflog identity name\r
467 </simpara>\r
468 </listitem>\r
469 <listitem>\r
470 <simpara>\r
471 <emphasis>%gN</emphasis>: reflog identity name (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
472 </simpara>\r
473 </listitem>\r
474 <listitem>\r
475 <simpara>\r
476 <emphasis>%ge</emphasis>: reflog identity email\r
477 </simpara>\r
478 </listitem>\r
479 <listitem>\r
480 <simpara>\r
481 <emphasis>%gE</emphasis>: reflog identity email (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
482 </simpara>\r
483 </listitem>\r
484 <listitem>\r
485 <simpara>\r
486 <emphasis>%gs</emphasis>: reflog subject\r
487 </simpara>\r
488 </listitem>\r
489 <listitem>\r
490 <simpara>\r
491 <emphasis>%Cred</emphasis>: switch color to red\r
492 </simpara>\r
493 </listitem>\r
494 <listitem>\r
495 <simpara>\r
496 <emphasis>%Cgreen</emphasis>: switch color to green\r
497 </simpara>\r
498 </listitem>\r
499 <listitem>\r
500 <simpara>\r
501 <emphasis>%Cblue</emphasis>: switch color to blue\r
502 </simpara>\r
503 </listitem>\r
504 <listitem>\r
505 <simpara>\r
506 <emphasis>%Creset</emphasis>: reset color\r
507 </simpara>\r
508 </listitem>\r
509 <listitem>\r
510 <simpara>\r
511 <emphasis>%C(&#8230;)</emphasis>: color specification, as described in color.branch.* config option\r
512 </simpara>\r
513 </listitem>\r
514 <listitem>\r
515 <simpara>\r
516 <emphasis>%m</emphasis>: left, right or boundary mark\r
517 </simpara>\r
518 </listitem>\r
519 <listitem>\r
520 <simpara>\r
521 <emphasis>%n</emphasis>: newline\r
522 </simpara>\r
523 </listitem>\r
524 <listitem>\r
525 <simpara>\r
526 <emphasis>%%</emphasis>: a raw <emphasis>%</emphasis>\r
527 </simpara>\r
528 </listitem>\r
529 <listitem>\r
530 <simpara>\r
531 <emphasis>%x00</emphasis>: print a byte from a hex code\r
532 </simpara>\r
533 </listitem>\r
534 <listitem>\r
535 <simpara>\r
536 <emphasis>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</emphasis>: switch line wrapping, like the -w option of\r
537   <xref linkend="git-shortlog(1)" />.\r
538 </simpara>\r
539 </listitem>\r
540 </itemizedlist>\r
541 </listitem>\r
542 </itemizedlist>\r
543 <note><simpara>Some placeholders may depend on other options given to the\r
544 revision traversal engine. For example, the <emphasis>%g*</emphasis> reflog options will\r
545 insert an empty string unless we are traversing reflog entries (e.g., by\r
546 <emphasis>git log -g</emphasis>). The <emphasis>%d</emphasis> placeholder will use the "short" decoration\r
547 format if <emphasis>--decorate</emphasis> was not already provided on the command line.</simpara></note>\r
548 <simpara>If you add a <emphasis>+</emphasis> (plus sign) after <emphasis>%</emphasis> of a placeholder, a line-feed\r
549 is inserted immediately before the expansion if and only if the\r
550 placeholder expands to a non-empty string.</simpara>\r
551 <simpara>If you add a <emphasis>-</emphasis> (minus sign) after <emphasis>%</emphasis> of a placeholder, line-feeds that\r
552 immediately precede the expansion are deleted if and only if the\r
553 placeholder expands to an empty string.</simpara>\r
554 <simpara>If you add a ` ` (space) after <emphasis>%</emphasis> of a placeholder, a space\r
555 is inserted immediately before the expansion if and only if the\r
556 placeholder expands to a non-empty string.</simpara>\r
557 <itemizedlist>\r
558 <listitem>\r
559 <simpara>\r
560 <emphasis>tformat:</emphasis>\r
561 </simpara>\r
562 <simpara>The <emphasis>tformat:</emphasis> format works exactly like <emphasis>format:</emphasis>, except that it\r
563 provides "terminator" semantics instead of "separator" semantics. In\r
564 other words, each commit has the message terminator character (usually a\r
565 newline) appended, rather than a separator placed between entries.\r
566 This means that the final entry of a single-line format will be properly\r
567 terminated with a new line, just as the "oneline" format does.\r
568 For example:</simpara>\r
569 <screen>$ git log -2 --pretty=format:%h 4da45bef \\r
570   | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'\r
571 4da45be\r
572 7134973 -- NO NEWLINE\r
574 $ git log -2 --pretty=tformat:%h 4da45bef \\r
575   | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'\r
576 4da45be\r
577 7134973</screen>\r
578 <simpara>In addition, any unrecognized string that has a <emphasis>%</emphasis> in it is interpreted\r
579 as if it has <emphasis>tformat:</emphasis> in front of it.  For example, these two are\r
580 equivalent:</simpara>\r
581 <screen>$ git log -2 --pretty=tformat:%h 4da45bef\r
582 $ git log -2 --pretty=%h 4da45bef</screen>\r
583 </listitem>\r
584 </itemizedlist>\r
585 </simplesect>\r
586 <simplesect id="git-show(1)__examples">\r
587 <title>EXAMPLES</title>\r
588 <variablelist>\r
589 <varlistentry>\r
590 <term>\r
591 <emphasis>git show v1.0.0</emphasis>\r
592 </term>\r
593 <listitem>\r
594 <simpara>\r
595         Shows the tag <emphasis>v1.0.0</emphasis>, along with the object the tags\r
596         points at.\r
597 </simpara>\r
598 </listitem>\r
599 </varlistentry>\r
600 <varlistentry>\r
601 <term>\r
602 <emphasis>git show v1.0.0^{tree}</emphasis>\r
603 </term>\r
604 <listitem>\r
605 <simpara>\r
606         Shows the tree pointed to by the tag <emphasis>v1.0.0</emphasis>.\r
607 </simpara>\r
608 </listitem>\r
609 </varlistentry>\r
610 <varlistentry>\r
611 <term>\r
612 <emphasis>git show -s --format=%s v1.0.0^{commit}</emphasis>\r
613 </term>\r
614 <listitem>\r
615 <simpara>\r
616         Shows the subject of the commit pointed to by the\r
617         tag <emphasis>v1.0.0</emphasis>.\r
618 </simpara>\r
619 </listitem>\r
620 </varlistentry>\r
621 <varlistentry>\r
622 <term>\r
623 <emphasis>git show next~10:Documentation/README</emphasis>\r
624 </term>\r
625 <listitem>\r
626 <simpara>\r
627         Shows the contents of the file <emphasis>Documentation/README</emphasis> as\r
628         they were current in the 10th last commit of the branch\r
629         <emphasis>next</emphasis>.\r
630 </simpara>\r
631 </listitem>\r
632 </varlistentry>\r
633 <varlistentry>\r
634 <term>\r
635 <emphasis>git show master:Makefile master:t/Makefile</emphasis>\r
636 </term>\r
637 <listitem>\r
638 <simpara>\r
639         Concatenates the contents of said Makefiles in the head\r
640         of the branch <emphasis>master</emphasis>.\r
641 </simpara>\r
642 </listitem>\r
643 </varlistentry>\r
644 </variablelist>\r
645 </simplesect>\r
646 <simplesect id="git-show(1)__discussion">\r
647 <title>Discussion</title>\r
648 <simpara>At the core level, git is character encoding agnostic.</simpara>\r
649 <itemizedlist>\r
650 <listitem>\r
651 <simpara>\r
652 The pathnames recorded in the index and in the tree objects\r
653    are treated as uninterpreted sequences of non-NUL bytes.\r
654    What readdir(2) returns are what are recorded and compared\r
655    with the data git keeps track of, which in turn are expected\r
656    to be what lstat(2) and creat(2) accepts.  There is no such\r
657    thing as pathname encoding translation.\r
658 </simpara>\r
659 </listitem>\r
660 <listitem>\r
661 <simpara>\r
662 The contents of the blob objects are uninterpreted sequences\r
663    of bytes.  There is no encoding translation at the core\r
664    level.\r
665 </simpara>\r
666 </listitem>\r
667 <listitem>\r
668 <simpara>\r
669 The commit log messages are uninterpreted sequences of non-NUL\r
670    bytes.\r
671 </simpara>\r
672 </listitem>\r
673 </itemizedlist>\r
674 <simpara>Although we encourage that the commit log messages are encoded\r
675 in UTF-8, both the core and git Porcelain are designed not to\r
676 force UTF-8 on projects.  If all participants of a particular\r
677 project find it more convenient to use legacy encodings, git\r
678 does not forbid it.  However, there are a few things to keep in\r
679 mind.</simpara>\r
680 <orderedlist numeration="arabic">\r
681 <listitem>\r
682 <simpara>\r
683 <emphasis>git commit</emphasis> and <emphasis>git commit-tree</emphasis> issues\r
684   a warning if the commit log message given to it does not look\r
685   like a valid UTF-8 string, unless you explicitly say your\r
686   project uses a legacy encoding.  The way to say this is to\r
687   have i18n.commitencoding in <emphasis>.git/config</emphasis> file, like this:\r
688 </simpara>\r
689 <screen>[i18n]\r
690         commitencoding = ISO-8859-1</screen>\r
691 <simpara>Commit objects created with the above setting record the value\r
692 of <emphasis>i18n.commitencoding</emphasis> in its <emphasis>encoding</emphasis> header.  This is to\r
693 help other people who look at them later.  Lack of this header\r
694 implies that the commit log message is encoded in UTF-8.</simpara>\r
695 </listitem>\r
696 <listitem>\r
697 <simpara>\r
698 <emphasis>git log</emphasis>, <emphasis>git show</emphasis>, <emphasis>git blame</emphasis> and friends look at the\r
699   <emphasis>encoding</emphasis> header of a commit object, and try to re-code the\r
700   log message into UTF-8 unless otherwise specified.  You can\r
701   specify the desired output encoding with\r
702   <emphasis>i18n.logoutputencoding</emphasis> in <emphasis>.git/config</emphasis> file, like this:\r
703 </simpara>\r
704 <screen>[i18n]\r
705         logoutputencoding = ISO-8859-1</screen>\r
706 <simpara>If you do not have this configuration variable, the value of\r
707 <emphasis>i18n.commitencoding</emphasis> is used instead.</simpara>\r
708 </listitem>\r
709 </orderedlist>\r
710 <simpara>Note that we deliberately chose not to re-code the commit log\r
711 message when a commit is made to force UTF-8 at the commit\r
712 object level, because re-coding to UTF-8 is not necessarily a\r
713 reversible operation.</simpara>\r
714 </simplesect>\r
715 <simplesect id="git-show(1)__git">\r
716 <title>GIT</title>\r
717 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>\r
718 </simplesect>\r
719 </sect2>\r