updated git doc
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / git-log.xml
blobbb820a8414734b6e75f1192f9e94676d263da19e
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">\r
3 \r
4 <article lang="en" id="git-log(1)">\r
5 <articleinfo>\r
6     <title>git-log(1)</title>\r
7 <indexterm>\r
8 <primary>git-log(1)</primary>\r
9 </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-log - Show commit logs</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <blockquote>\r
18 <literallayout><emphasis>git log</emphasis> [&lt;options&gt;] [&lt;since&gt;..&lt;until&gt;] [[--] &lt;path&gt;&#8230;]</literallayout>\r
19 </blockquote>\r
20 </simplesect>\r
21 <simplesect id="_description">\r
22 <title>DESCRIPTION</title>\r
23 <simpara>Shows the commit logs.</simpara>\r
24 <simpara>The command takes options applicable to the <emphasis>git rev-list</emphasis>\r
25 command to control what is shown and how, and options applicable to\r
26 the <emphasis>git diff-*</emphasis> commands to control how the changes\r
27 each commit introduces are shown.</simpara>\r
28 </simplesect>\r
29 <simplesect id="_options">\r
30 <title>OPTIONS</title>\r
31 <variablelist>\r
32 <varlistentry>\r
33 <term>\r
34 -&lt;n&gt;\r
35 </term>\r
36 <listitem>\r
37 <simpara>\r
38         Limits the number of commits to show.\r
39         Note that this is a commit limiting option, see below.\r
40 </simpara>\r
41 </listitem>\r
42 </varlistentry>\r
43 <varlistentry>\r
44 <term>\r
45 &lt;since&gt;..&lt;until&gt;\r
46 </term>\r
47 <listitem>\r
48 <simpara>\r
49         Show only commits between the named two commits.  When\r
50         either &lt;since&gt; or &lt;until&gt; is omitted, it defaults to\r
51         <emphasis>HEAD</emphasis>, i.e. the tip of the current branch.\r
52         For a more complete list of ways to spell &lt;since&gt;\r
53         and &lt;until&gt;, see <xref linkend="gitrevisions(7)" />.\r
54 </simpara>\r
55 </listitem>\r
56 </varlistentry>\r
57 <varlistentry>\r
58 <term>\r
59 --follow\r
60 </term>\r
61 <listitem>\r
62 <simpara>\r
63         Continue listing the history of a file beyond renames\r
64         (works only for a single file).\r
65 </simpara>\r
66 </listitem>\r
67 </varlistentry>\r
68 <varlistentry>\r
69 <term>\r
70 --no-decorate\r
71 </term>\r
72 <term>\r
73 --decorate[=short|full|no]\r
74 </term>\r
75 <listitem>\r
76 <simpara>\r
77         Print out the ref names of any commits that are shown. If <emphasis>short</emphasis> is\r
78         specified, the ref name prefixes <emphasis>refs/heads/</emphasis>, <emphasis>refs/tags/</emphasis> and\r
79         <emphasis>refs/remotes/</emphasis> will not be printed. If <emphasis>full</emphasis> is specified, the\r
80         full ref name (including prefix) will be printed. The default option\r
81         is <emphasis>short</emphasis>.\r
82 </simpara>\r
83 </listitem>\r
84 </varlistentry>\r
85 <varlistentry>\r
86 <term>\r
87 --source\r
88 </term>\r
89 <listitem>\r
90 <simpara>\r
91         Print out the ref name given on the command line by which each\r
92         commit was reached.\r
93 </simpara>\r
94 </listitem>\r
95 </varlistentry>\r
96 <varlistentry>\r
97 <term>\r
98 --full-diff\r
99 </term>\r
100 <listitem>\r
101 <simpara>\r
102         Without this flag, "git log -p &lt;path&gt;&#8230;" shows commits that\r
103         touch the specified paths, and diffs about the same specified\r
104         paths.  With this, the full diff is shown for commits that touch\r
105         the specified paths; this means that "&lt;path&gt;&#8230;" limits only\r
106         commits, and doesn't limit diff for those commits.\r
107 </simpara>\r
108 <simpara>Note that this affects all diff-based output types, e.g. those\r
109 produced by --stat etc.</simpara>\r
110 </listitem>\r
111 </varlistentry>\r
112 <varlistentry>\r
113 <term>\r
114 --log-size\r
115 </term>\r
116 <listitem>\r
117 <simpara>\r
118         Before the log message print out its size in bytes. Intended\r
119         mainly for porcelain tools consumption. If git is unable to\r
120         produce a valid value size is set to zero.\r
121         Note that only message is considered, if also a diff is shown\r
122         its size is not included.\r
123 </simpara>\r
124 </listitem>\r
125 </varlistentry>\r
126 <varlistentry>\r
127 <term>\r
128 [--] &lt;path&gt;&#8230;\r
129 </term>\r
130 <listitem>\r
131 <simpara>\r
132         Show only commits that are enough to explain how the files\r
133         that match the specified paths came to be.  See "History\r
134         Simplification" below for details and other simplification\r
135         modes.\r
136 </simpara>\r
137 <simpara>To prevent confusion with options and branch names, paths may need to\r
138 be prefixed with "-- " to separate them from options or refnames.</simpara>\r
139 </listitem>\r
140 </varlistentry>\r
141 </variablelist>\r
142 <section id="_commit_limiting">\r
143 <title>Commit Limiting</title>\r
144 <simpara>Besides specifying a range of commits that should be listed using the\r
145 special notations explained in the description, additional commit\r
146 limiting may be applied. Note that they are applied before commit\r
147 ordering and formatting options, such as <emphasis>--reverse</emphasis>.</simpara>\r
148 <variablelist>\r
149 <varlistentry>\r
150 <term>\r
151 -n <emphasis>number</emphasis>\r
152 </term>\r
153 <term>\r
154 --max-count=&lt;number&gt;\r
155 </term>\r
156 <listitem>\r
157 <simpara>\r
158         Limit the number of commits to output.\r
159 </simpara>\r
160 </listitem>\r
161 </varlistentry>\r
162 <varlistentry>\r
163 <term>\r
164 --skip=&lt;number&gt;\r
165 </term>\r
166 <listitem>\r
167 <simpara>\r
168         Skip <emphasis>number</emphasis> commits before starting to show the commit output.\r
169 </simpara>\r
170 </listitem>\r
171 </varlistentry>\r
172 <varlistentry>\r
173 <term>\r
174 --since=&lt;date&gt;\r
175 </term>\r
176 <term>\r
177 --after=&lt;date&gt;\r
178 </term>\r
179 <listitem>\r
180 <simpara>\r
181         Show commits more recent than a specific date.\r
182 </simpara>\r
183 </listitem>\r
184 </varlistentry>\r
185 <varlistentry>\r
186 <term>\r
187 --until=&lt;date&gt;\r
188 </term>\r
189 <term>\r
190 --before=&lt;date&gt;\r
191 </term>\r
192 <listitem>\r
193 <simpara>\r
194         Show commits older than a specific date.\r
195 </simpara>\r
196 </listitem>\r
197 </varlistentry>\r
198 <varlistentry>\r
199 <term>\r
200 --author=&lt;pattern&gt;\r
201 </term>\r
202 <term>\r
203 --committer=&lt;pattern&gt;\r
204 </term>\r
205 <listitem>\r
206 <simpara>\r
207         Limit the commits output to ones with author/committer\r
208         header lines that match the specified pattern (regular expression).\r
209 </simpara>\r
210 </listitem>\r
211 </varlistentry>\r
212 <varlistentry>\r
213 <term>\r
214 --grep=&lt;pattern&gt;\r
215 </term>\r
216 <listitem>\r
217 <simpara>\r
218         Limit the commits output to ones with log message that\r
219         matches the specified pattern (regular expression).\r
220 </simpara>\r
221 </listitem>\r
222 </varlistentry>\r
223 <varlistentry>\r
224 <term>\r
225 --all-match\r
226 </term>\r
227 <listitem>\r
228 <simpara>\r
229         Limit the commits output to ones that match all given --grep,\r
230         --author and --committer instead of ones that match at least one.\r
231 </simpara>\r
232 </listitem>\r
233 </varlistentry>\r
234 <varlistentry>\r
235 <term>\r
236 -i\r
237 </term>\r
238 <term>\r
239 --regexp-ignore-case\r
240 </term>\r
241 <listitem>\r
242 <simpara>\r
243         Match the regexp limiting patterns without regard to letters case.\r
244 </simpara>\r
245 </listitem>\r
246 </varlistentry>\r
247 <varlistentry>\r
248 <term>\r
249 -E\r
250 </term>\r
251 <term>\r
252 --extended-regexp\r
253 </term>\r
254 <listitem>\r
255 <simpara>\r
256         Consider the limiting patterns to be extended regular expressions\r
257         instead of the default basic regular expressions.\r
258 </simpara>\r
259 </listitem>\r
260 </varlistentry>\r
261 <varlistentry>\r
262 <term>\r
263 -F\r
264 </term>\r
265 <term>\r
266 --fixed-strings\r
267 </term>\r
268 <listitem>\r
269 <simpara>\r
270         Consider the limiting patterns to be fixed strings (don't interpret\r
271         pattern as a regular expression).\r
272 </simpara>\r
273 </listitem>\r
274 </varlistentry>\r
275 <varlistentry>\r
276 <term>\r
277 --remove-empty\r
278 </term>\r
279 <listitem>\r
280 <simpara>\r
281         Stop when a given path disappears from the tree.\r
282 </simpara>\r
283 </listitem>\r
284 </varlistentry>\r
285 <varlistentry>\r
286 <term>\r
287 --merges\r
288 </term>\r
289 <listitem>\r
290 <simpara>\r
291         Print only merge commits. This is exactly the same as <emphasis>--min-parents=2</emphasis>.\r
292 </simpara>\r
293 </listitem>\r
294 </varlistentry>\r
295 <varlistentry>\r
296 <term>\r
297 --no-merges\r
298 </term>\r
299 <listitem>\r
300 <simpara>\r
301         Do not print commits with more than one parent. This is\r
302         exactly the same as <emphasis>--max-parents=1</emphasis>.\r
303 </simpara>\r
304 </listitem>\r
305 </varlistentry>\r
306 <varlistentry>\r
307 <term>\r
308 --min-parents=&lt;number&gt;\r
309 </term>\r
310 <term>\r
311 --max-parents=&lt;number&gt;\r
312 </term>\r
313 <term>\r
314 --no-min-parents\r
315 </term>\r
316 <term>\r
317 --no-max-parents\r
318 </term>\r
319 <listitem>\r
320 <simpara>\r
321         Show only commits which have at least (or at most) that many\r
322         commits. In particular, <emphasis>--max-parents=1</emphasis> is the same as <emphasis>--no-merges</emphasis>,\r
323         <emphasis>--min-parents=2</emphasis> is the same as <emphasis>--merges</emphasis>.  <emphasis>--max-parents=0</emphasis>\r
324         gives all root commits and <emphasis>--min-parents=3</emphasis> all octopus merges.\r
325 </simpara>\r
326 <simpara><emphasis>--no-min-parents</emphasis> and <emphasis>--no-max-parents</emphasis> reset these limits (to no limit)\r
327 again.  Equivalent forms are <emphasis>--min-parents=0</emphasis> (any commit has 0 or more\r
328 parents) and <emphasis>--max-parents=-1</emphasis> (negative numbers denote no upper limit).</simpara>\r
329 </listitem>\r
330 </varlistentry>\r
331 <varlistentry>\r
332 <term>\r
333 --first-parent\r
334 </term>\r
335 <listitem>\r
336 <simpara>\r
337         Follow only the first parent commit upon seeing a merge\r
338         commit.  This option can give a better overview when\r
339         viewing the evolution of a particular topic branch,\r
340         because merges into a topic branch tend to be only about\r
341         adjusting to updated upstream from time to time, and\r
342         this option allows you to ignore the individual commits\r
343         brought in to your history by such a merge.\r
344 </simpara>\r
345 </listitem>\r
346 </varlistentry>\r
347 <varlistentry>\r
348 <term>\r
349 --not\r
350 </term>\r
351 <listitem>\r
352 <simpara>\r
353         Reverses the meaning of the <emphasis>&#94;</emphasis> prefix (or lack thereof)\r
354         for all following revision specifiers, up to the next <emphasis>--not</emphasis>.\r
355 </simpara>\r
356 </listitem>\r
357 </varlistentry>\r
358 <varlistentry>\r
359 <term>\r
360 --all\r
361 </term>\r
362 <listitem>\r
363 <simpara>\r
364         Pretend as if all the refs in <emphasis>refs/</emphasis> are listed on the\r
365         command line as <emphasis>&lt;commit&gt;</emphasis>.\r
366 </simpara>\r
367 </listitem>\r
368 </varlistentry>\r
369 <varlistentry>\r
370 <term>\r
371 --branches[=&lt;pattern&gt;]\r
372 </term>\r
373 <listitem>\r
374 <simpara>\r
375         Pretend as if all the refs in <emphasis>refs/heads</emphasis> are listed\r
376         on the command line as <emphasis>&lt;commit&gt;</emphasis>. If <emphasis>&lt;pattern&gt;</emphasis> is given, limit\r
377         branches to ones matching given shell glob. If pattern lacks <emphasis>?</emphasis>,\r
378         <emphasis>&#42;</emphasis>, or <emphasis>[</emphasis>, <emphasis>/&#42;</emphasis> at the end is implied.\r
379 </simpara>\r
380 </listitem>\r
381 </varlistentry>\r
382 <varlistentry>\r
383 <term>\r
384 --tags[=&lt;pattern&gt;]\r
385 </term>\r
386 <listitem>\r
387 <simpara>\r
388         Pretend as if all the refs in <emphasis>refs/tags</emphasis> are listed\r
389         on the command line as <emphasis>&lt;commit&gt;</emphasis>. If <emphasis>&lt;pattern&gt;</emphasis> is given, limit\r
390         tags to ones matching given shell glob. If pattern lacks <emphasis>?</emphasis>, <emphasis>&#42;</emphasis>,\r
391         or <emphasis>[</emphasis>, <emphasis>/&#42;</emphasis> at the end is implied.\r
392 </simpara>\r
393 </listitem>\r
394 </varlistentry>\r
395 <varlistentry>\r
396 <term>\r
397 --remotes[=&lt;pattern&gt;]\r
398 </term>\r
399 <listitem>\r
400 <simpara>\r
401         Pretend as if all the refs in <emphasis>refs/remotes</emphasis> are listed\r
402         on the command line as <emphasis>&lt;commit&gt;</emphasis>. If <emphasis>&lt;pattern&gt;</emphasis> is given, limit\r
403         remote-tracking branches to ones matching given shell glob.\r
404         If pattern lacks <emphasis>?</emphasis>, <emphasis>&#42;</emphasis>, or <emphasis>[</emphasis>, <emphasis>/&#42;</emphasis> at the end is implied.\r
405 </simpara>\r
406 </listitem>\r
407 </varlistentry>\r
408 <varlistentry>\r
409 <term>\r
410 --glob=&lt;glob-pattern&gt;\r
411 </term>\r
412 <listitem>\r
413 <simpara>\r
414         Pretend as if all the refs matching shell glob <emphasis>&lt;glob-pattern&gt;</emphasis>\r
415         are listed on the command line as <emphasis>&lt;commit&gt;</emphasis>. Leading <emphasis>refs/</emphasis>,\r
416         is automatically prepended if missing. If pattern lacks <emphasis>?</emphasis>, <emphasis>&#42;</emphasis>,\r
417         or <emphasis>[</emphasis>, <emphasis>/&#42;</emphasis> at the end is implied.\r
418 </simpara>\r
419 </listitem>\r
420 </varlistentry>\r
421 <varlistentry>\r
422 <term>\r
423 --ignore-missing\r
424 </term>\r
425 <listitem>\r
426 <simpara>\r
427         Upon seeing an invalid object name in the input, pretend as if\r
428         the bad input was not given.\r
429 </simpara>\r
430 </listitem>\r
431 </varlistentry>\r
432 <varlistentry>\r
433 <term>\r
434 --bisect\r
435 </term>\r
436 <listitem>\r
437 <simpara>\r
438         Pretend as if the bad bisection ref <emphasis>refs/bisect/bad</emphasis>\r
439         was listed and as if it was followed by <emphasis>--not</emphasis> and the good\r
440         bisection refs <emphasis>refs/bisect/good-*</emphasis> on the command\r
441         line.\r
442 </simpara>\r
443 </listitem>\r
444 </varlistentry>\r
445 <varlistentry>\r
446 <term>\r
447 --stdin\r
448 </term>\r
449 <listitem>\r
450 <simpara>\r
451         In addition to the <emphasis>&lt;commit&gt;</emphasis> listed on the command\r
452         line, read them from the standard input. If a <emphasis>--</emphasis> separator is\r
453         seen, stop reading commits and start reading paths to limit the\r
454         result.\r
455 </simpara>\r
456 </listitem>\r
457 </varlistentry>\r
458 <varlistentry>\r
459 <term>\r
460 --cherry-mark\r
461 </term>\r
462 <listitem>\r
463 <simpara>\r
464         Like <emphasis>--cherry-pick</emphasis> (see below) but mark equivalent commits\r
465         with <emphasis>=</emphasis> rather than omitting them, and inequivalent ones with <emphasis>+</emphasis>.\r
466 </simpara>\r
467 </listitem>\r
468 </varlistentry>\r
469 <varlistentry>\r
470 <term>\r
471 --cherry-pick\r
472 </term>\r
473 <listitem>\r
474 <simpara>\r
475         Omit any commit that introduces the same change as\r
476         another commit on the "other side" when the set of\r
477         commits are limited with symmetric difference.\r
478 </simpara>\r
479 <simpara>For example, if you have two branches, <emphasis>A</emphasis> and <emphasis>B</emphasis>, a usual way\r
480 to list all commits on only one side of them is with\r
481 <emphasis>--left-right</emphasis> (see the example below in the description of\r
482 the <emphasis>--left-right</emphasis> option).  It however shows the commits that were cherry-picked\r
483 from the other branch (for example, "3rd on b" may be cherry-picked\r
484 from branch A).  With this option, such pairs of commits are\r
485 excluded from the output.</simpara>\r
486 </listitem>\r
487 </varlistentry>\r
488 <varlistentry>\r
489 <term>\r
490 --left-only\r
491 </term>\r
492 <term>\r
493 --right-only\r
494 </term>\r
495 <listitem>\r
496 <simpara>\r
497         List only commits on the respective side of a symmetric range,\r
498         i.e. only those which would be marked <emphasis>&lt;</emphasis> resp. <emphasis>&gt;</emphasis> by\r
499         <emphasis>--left-right</emphasis>.\r
500 </simpara>\r
501 <simpara>For example, <emphasis>--cherry-pick --right-only A...B</emphasis> omits those\r
502 commits from <emphasis>B</emphasis> which are in <emphasis>A</emphasis> or are patch-equivalent to a commit in\r
503 <emphasis>A</emphasis>. In other words, this lists the <emphasis>+</emphasis> commits from <emphasis>git cherry A B</emphasis>.\r
504 More precisely, <emphasis>--cherry-pick --right-only --no-merges</emphasis> gives the exact\r
505 list.</simpara>\r
506 </listitem>\r
507 </varlistentry>\r
508 <varlistentry>\r
509 <term>\r
510 --cherry\r
511 </term>\r
512 <listitem>\r
513 <simpara>\r
514         A synonym for <emphasis>--right-only --cherry-mark --no-merges</emphasis>; useful to\r
515         limit the output to the commits on our side and mark those that\r
516         have been applied to the other side of a forked history with\r
517         <emphasis>git log --cherry upstream...mybranch</emphasis>, similar to\r
518         <emphasis>git cherry upstream mybranch</emphasis>.\r
519 </simpara>\r
520 </listitem>\r
521 </varlistentry>\r
522 <varlistentry>\r
523 <term>\r
524 -g\r
525 </term>\r
526 <term>\r
527 --walk-reflogs\r
528 </term>\r
529 <listitem>\r
530 <simpara>\r
531         Instead of walking the commit ancestry chain, walk\r
532         reflog entries from the most recent one to older ones.\r
533         When this option is used you cannot specify commits to\r
534         exclude (that is, <emphasis>&#94;commit</emphasis>, <emphasis>commit1..commit2</emphasis>,\r
535         nor <emphasis>commit1...commit2</emphasis> notations cannot be used).\r
536 </simpara>\r
537 <simpara>With <emphasis>--pretty</emphasis> format other than oneline (for obvious reasons),\r
538 this causes the output to have two extra lines of information\r
539 taken from the reflog.  By default, <emphasis>commit@{Nth}</emphasis> notation is\r
540 used in the output.  When the starting commit is specified as\r
541 <emphasis>commit@{now}</emphasis>, output also uses <emphasis>commit@{timestamp}</emphasis> notation\r
542 instead.  Under <emphasis>--pretty=oneline</emphasis>, the commit message is\r
543 prefixed with this information on the same line.\r
544 This option cannot be combined with <emphasis>--reverse</emphasis>.\r
545 See also <xref linkend="git-reflog(1)" />.</simpara>\r
546 </listitem>\r
547 </varlistentry>\r
548 <varlistentry>\r
549 <term>\r
550 --merge\r
551 </term>\r
552 <listitem>\r
553 <simpara>\r
554         After a failed merge, show refs that touch files having a\r
555         conflict and don't exist on all heads to merge.\r
556 </simpara>\r
557 </listitem>\r
558 </varlistentry>\r
559 <varlistentry>\r
560 <term>\r
561 --boundary\r
562 </term>\r
563 <listitem>\r
564 <simpara>\r
565         Output uninteresting commits at the boundary, which are usually\r
566         not shown.\r
567 </simpara>\r
568 </listitem>\r
569 </varlistentry>\r
570 </variablelist>\r
571 </section>\r
572 <section id="_history_simplification">\r
573 <title>History Simplification</title>\r
574 <simpara>Sometimes you are only interested in parts of the history, for example the\r
575 commits modifying a particular &lt;path&gt;. But there are two parts of\r
576 <emphasis>History Simplification</emphasis>, one part is selecting the commits and the other\r
577 is how to do it, as there are various strategies to simplify the history.</simpara>\r
578 <simpara>The following options select the commits to be shown:</simpara>\r
579 <variablelist>\r
580 <varlistentry>\r
581 <term>\r
582 &lt;paths&gt;\r
583 </term>\r
584 <listitem>\r
585 <simpara>\r
586         Commits modifying the given &lt;paths&gt; are selected.\r
587 </simpara>\r
588 </listitem>\r
589 </varlistentry>\r
590 <varlistentry>\r
591 <term>\r
592 --simplify-by-decoration\r
593 </term>\r
594 <listitem>\r
595 <simpara>\r
596         Commits that are referred by some branch or tag are selected.\r
597 </simpara>\r
598 </listitem>\r
599 </varlistentry>\r
600 </variablelist>\r
601 <simpara>Note that extra commits can be shown to give a meaningful history.</simpara>\r
602 <simpara>The following options affect the way the simplification is performed:</simpara>\r
603 <variablelist>\r
604 <varlistentry>\r
605 <term>\r
606 Default mode\r
607 </term>\r
608 <listitem>\r
609 <simpara>\r
610         Simplifies the history to the simplest history explaining the\r
611         final state of the tree. Simplest because it prunes some side\r
612         branches if the end result is the same (i.e. merging branches\r
613         with the same content)\r
614 </simpara>\r
615 </listitem>\r
616 </varlistentry>\r
617 <varlistentry>\r
618 <term>\r
619 --full-history\r
620 </term>\r
621 <listitem>\r
622 <simpara>\r
623         Same as the default mode, but does not prune some history.\r
624 </simpara>\r
625 </listitem>\r
626 </varlistentry>\r
627 <varlistentry>\r
628 <term>\r
629 --dense\r
630 </term>\r
631 <listitem>\r
632 <simpara>\r
633         Only the selected commits are shown, plus some to have a\r
634         meaningful history.\r
635 </simpara>\r
636 </listitem>\r
637 </varlistentry>\r
638 <varlistentry>\r
639 <term>\r
640 --sparse\r
641 </term>\r
642 <listitem>\r
643 <simpara>\r
644         All commits in the simplified history are shown.\r
645 </simpara>\r
646 </listitem>\r
647 </varlistentry>\r
648 <varlistentry>\r
649 <term>\r
650 --simplify-merges\r
651 </term>\r
652 <listitem>\r
653 <simpara>\r
654         Additional option to <emphasis>--full-history</emphasis> to remove some needless\r
655         merges from the resulting history, as there are no selected\r
656         commits contributing to this merge.\r
657 </simpara>\r
658 </listitem>\r
659 </varlistentry>\r
660 <varlistentry>\r
661 <term>\r
662 --ancestry-path\r
663 </term>\r
664 <listitem>\r
665 <simpara>\r
666         When given a range of commits to display (e.g. <emphasis>commit1..commit2</emphasis>\r
667         or <emphasis>commit2 &#94;commit1</emphasis>), only display commits that exist\r
668         directly on the ancestry chain between the <emphasis>commit1</emphasis> and\r
669         <emphasis>commit2</emphasis>, i.e. commits that are both descendants of <emphasis>commit1</emphasis>,\r
670         and ancestors of <emphasis>commit2</emphasis>.\r
671 </simpara>\r
672 </listitem>\r
673 </varlistentry>\r
674 </variablelist>\r
675 <simpara>A more detailed explanation follows.</simpara>\r
676 <simpara>Suppose you specified <emphasis>foo</emphasis> as the &lt;paths&gt;.  We shall call commits\r
677 that modify <emphasis>foo</emphasis> !TREESAME, and the rest TREESAME.  (In a diff\r
678 filtered for <emphasis>foo</emphasis>, they look different and equal, respectively.)</simpara>\r
679 <simpara>In the following, we will always refer to the same example history to\r
680 illustrate the differences between simplification settings.  We assume\r
681 that you are filtering for a file <emphasis>foo</emphasis> in this commit graph:</simpara>\r
682 <screen>          .-A---M---N---O---P\r
683          /     /   /   /   /\r
684         I     B   C   D   E\r
685          \   /   /   /   /\r
686           `-------------'</screen>\r
687 <simpara>The horizontal line of history A---P is taken to be the first parent of\r
688 each merge.  The commits are:</simpara>\r
689 <itemizedlist>\r
690 <listitem>\r
691 <simpara>\r
692 <emphasis>I</emphasis> is the initial commit, in which <emphasis>foo</emphasis> exists with contents\r
693   "asdf", and a file <emphasis>quux</emphasis> exists with contents "quux".  Initial\r
694   commits are compared to an empty tree, so <emphasis>I</emphasis> is !TREESAME.\r
695 </simpara>\r
696 </listitem>\r
697 <listitem>\r
698 <simpara>\r
699 In <emphasis>A</emphasis>, <emphasis>foo</emphasis> contains just "foo".\r
700 </simpara>\r
701 </listitem>\r
702 <listitem>\r
703 <simpara>\r
704 <emphasis>B</emphasis> contains the same change as <emphasis>A</emphasis>.  Its merge <emphasis>M</emphasis> is trivial and\r
705   hence TREESAME to all parents.\r
706 </simpara>\r
707 </listitem>\r
708 <listitem>\r
709 <simpara>\r
710 <emphasis>C</emphasis> does not change <emphasis>foo</emphasis>, but its merge <emphasis>N</emphasis> changes it to "foobar",\r
711   so it is not TREESAME to any parent.\r
712 </simpara>\r
713 </listitem>\r
714 <listitem>\r
715 <simpara>\r
716 <emphasis>D</emphasis> sets <emphasis>foo</emphasis> to "baz".  Its merge <emphasis>O</emphasis> combines the strings from\r
717   <emphasis>N</emphasis> and <emphasis>D</emphasis> to "foobarbaz"; i.e., it is not TREESAME to any parent.\r
718 </simpara>\r
719 </listitem>\r
720 <listitem>\r
721 <simpara>\r
722 <emphasis>E</emphasis> changes <emphasis>quux</emphasis> to "xyzzy", and its merge <emphasis>P</emphasis> combines the\r
723   strings to "quux xyzzy".  Despite appearing interesting, <emphasis>P</emphasis> is\r
724   TREESAME to all parents.\r
725 </simpara>\r
726 </listitem>\r
727 </itemizedlist>\r
728 <simpara><emphasis>rev-list</emphasis> walks backwards through history, including or excluding\r
729 commits based on whether <emphasis>--full-history</emphasis> and/or parent rewriting\r
730 (via <emphasis>--parents</emphasis> or <emphasis>--children</emphasis>) are used.  The following settings\r
731 are available.</simpara>\r
732 <variablelist>\r
733 <varlistentry>\r
734 <term>\r
735 Default mode\r
736 </term>\r
737 <listitem>\r
738 <simpara>\r
739         Commits are included if they are not TREESAME to any parent\r
740         (though this can be changed, see <emphasis>--sparse</emphasis> below).  If the\r
741         commit was a merge, and it was TREESAME to one parent, follow\r
742         only that parent.  (Even if there are several TREESAME\r
743         parents, follow only one of them.)  Otherwise, follow all\r
744         parents.\r
745 </simpara>\r
746 <simpara>This results in:</simpara>\r
747 <screen>          .-A---N---O\r
748          /     /   /\r
749         I---------D</screen>\r
750 <simpara>Note how the rule to only follow the TREESAME parent, if one is\r
751 available, removed <emphasis>B</emphasis> from consideration entirely.  <emphasis>C</emphasis> was\r
752 considered via <emphasis>N</emphasis>, but is TREESAME.  Root commits are compared to an\r
753 empty tree, so <emphasis>I</emphasis> is !TREESAME.</simpara>\r
754 <simpara>Parent/child relations are only visible with --parents, but that does\r
755 not affect the commits selected in default mode, so we have shown the\r
756 parent lines.</simpara>\r
757 </listitem>\r
758 </varlistentry>\r
759 <varlistentry>\r
760 <term>\r
761 --full-history without parent rewriting\r
762 </term>\r
763 <listitem>\r
764 <simpara>\r
765         This mode differs from the default in one point: always follow\r
766         all parents of a merge, even if it is TREESAME to one of them.\r
767         Even if more than one side of the merge has commits that are\r
768         included, this does not imply that the merge itself is!  In\r
769         the example, we get\r
770 </simpara>\r
771 <screen>        I  A  B  N  D  O</screen>\r
772 <simpara><emphasis>P</emphasis> and <emphasis>M</emphasis> were excluded because they are TREESAME to a parent.  <emphasis>E</emphasis>,\r
773 <emphasis>C</emphasis> and <emphasis>B</emphasis> were all walked, but only <emphasis>B</emphasis> was !TREESAME, so the others\r
774 do not appear.</simpara>\r
775 <simpara>Note that without parent rewriting, it is not really possible to talk\r
776 about the parent/child relationships between the commits, so we show\r
777 them disconnected.</simpara>\r
778 </listitem>\r
779 </varlistentry>\r
780 <varlistentry>\r
781 <term>\r
782 --full-history with parent rewriting\r
783 </term>\r
784 <listitem>\r
785 <simpara>\r
786         Ordinary commits are only included if they are !TREESAME\r
787         (though this can be changed, see <emphasis>--sparse</emphasis> below).\r
788 </simpara>\r
789 <simpara>Merges are always included.  However, their parent list is rewritten:\r
790 Along each parent, prune away commits that are not included\r
791 themselves.  This results in</simpara>\r
792 <screen>          .-A---M---N---O---P\r
793          /     /   /   /   /\r
794         I     B   /   D   /\r
795          \   /   /   /   /\r
796           `-------------'</screen>\r
797 <simpara>Compare to <emphasis>--full-history</emphasis> without rewriting above.  Note that <emphasis>E</emphasis>\r
798 was pruned away because it is TREESAME, but the parent list of P was\r
799 rewritten to contain <emphasis>E</emphasis>'s parent <emphasis>I</emphasis>.  The same happened for <emphasis>C</emphasis> and\r
800 <emphasis>N</emphasis>.  Note also that <emphasis>P</emphasis> was included despite being TREESAME.</simpara>\r
801 </listitem>\r
802 </varlistentry>\r
803 </variablelist>\r
804 <simpara>In addition to the above settings, you can change whether TREESAME\r
805 affects inclusion:</simpara>\r
806 <variablelist>\r
807 <varlistentry>\r
808 <term>\r
809 --dense\r
810 </term>\r
811 <listitem>\r
812 <simpara>\r
813         Commits that are walked are included if they are not TREESAME\r
814         to any parent.\r
815 </simpara>\r
816 </listitem>\r
817 </varlistentry>\r
818 <varlistentry>\r
819 <term>\r
820 --sparse\r
821 </term>\r
822 <listitem>\r
823 <simpara>\r
824         All commits that are walked are included.\r
825 </simpara>\r
826 <simpara>Note that without <emphasis>--full-history</emphasis>, this still simplifies merges: if\r
827 one of the parents is TREESAME, we follow only that one, so the other\r
828 sides of the merge are never walked.</simpara>\r
829 </listitem>\r
830 </varlistentry>\r
831 <varlistentry>\r
832 <term>\r
833 --simplify-merges\r
834 </term>\r
835 <listitem>\r
836 <simpara>\r
837         First, build a history graph in the same way that\r
838         <emphasis>--full-history</emphasis> with parent rewriting does (see above).\r
839 </simpara>\r
840 <simpara>Then simplify each commit <emphasis>C</emphasis> to its replacement <emphasis>C'</emphasis> in the final\r
841 history according to the following rules:</simpara>\r
842 <itemizedlist>\r
843 <listitem>\r
844 <simpara>\r
845 Set <emphasis>C'</emphasis> to <emphasis>C</emphasis>.\r
846 </simpara>\r
847 </listitem>\r
848 <listitem>\r
849 <simpara>\r
850 Replace each parent <emphasis>P</emphasis> of <emphasis>C'</emphasis> with its simplification <emphasis>P'</emphasis>.  In\r
851   the process, drop parents that are ancestors of other parents, and\r
852   remove duplicates.\r
853 </simpara>\r
854 </listitem>\r
855 <listitem>\r
856 <simpara>\r
857 If after this parent rewriting, <emphasis>C'</emphasis> is a root or merge commit (has\r
858   zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.\r
859   Otherwise, it is replaced with its only parent.\r
860 </simpara>\r
861 </listitem>\r
862 </itemizedlist>\r
863 <simpara>The effect of this is best shown by way of comparing to\r
864 <emphasis>--full-history</emphasis> with parent rewriting.  The example turns into:</simpara>\r
865 <screen>          .-A---M---N---O\r
866          /     /       /\r
867         I     B       D\r
868          \   /       /\r
869           `---------'</screen>\r
870 <simpara>Note the major differences in <emphasis>N</emphasis> and <emphasis>P</emphasis> over <emphasis>--full-history</emphasis>:</simpara>\r
871 <itemizedlist>\r
872 <listitem>\r
873 <simpara>\r
874 <emphasis>N</emphasis>'s parent list had <emphasis>I</emphasis> removed, because it is an ancestor of the\r
875   other parent <emphasis>M</emphasis>.  Still, <emphasis>N</emphasis> remained because it is !TREESAME.\r
876 </simpara>\r
877 </listitem>\r
878 <listitem>\r
879 <simpara>\r
880 <emphasis>P</emphasis>'s parent list similarly had <emphasis>I</emphasis> removed.  <emphasis>P</emphasis> was then\r
881   removed completely, because it had one parent and is TREESAME.\r
882 </simpara>\r
883 </listitem>\r
884 </itemizedlist>\r
885 </listitem>\r
886 </varlistentry>\r
887 </variablelist>\r
888 <simpara>Finally, there is a fifth simplification mode available:</simpara>\r
889 <variablelist>\r
890 <varlistentry>\r
891 <term>\r
892 --ancestry-path\r
893 </term>\r
894 <listitem>\r
895 <simpara>\r
896         Limit the displayed commits to those directly on the ancestry\r
897         chain between the "from" and "to" commits in the given commit\r
898         range. I.e. only display commits that are ancestor of the "to"\r
899         commit, and descendants of the "from" commit.\r
900 </simpara>\r
901 <simpara>As an example use case, consider the following commit history:</simpara>\r
902 <screen>            D---E-------F\r
903            /     \       \\r
904           B---C---G---H---I---J\r
905          /                     \\r
906         A-------K---------------L--M</screen>\r
907 <simpara>A regular <emphasis>D..M</emphasis> computes the set of commits that are ancestors of <emphasis>M</emphasis>,\r
908 but excludes the ones that are ancestors of <emphasis>D</emphasis>. This is useful to see\r
909 what happened to the history leading to <emphasis>M</emphasis> since <emphasis>D</emphasis>, in the sense\r
910 that "what does <emphasis>M</emphasis> have that did not exist in <emphasis>D</emphasis>". The result in this\r
911 example would be all the commits, except <emphasis>A</emphasis> and <emphasis>B</emphasis> (and <emphasis>D</emphasis> itself,\r
912 of course).</simpara>\r
913 <simpara>When we want to find out what commits in <emphasis>M</emphasis> are contaminated with the\r
914 bug introduced by <emphasis>D</emphasis> and need fixing, however, we might want to view\r
915 only the subset of <emphasis>D..M</emphasis> that are actually descendants of <emphasis>D</emphasis>, i.e.\r
916 excluding <emphasis>C</emphasis> and <emphasis>K</emphasis>. This is exactly what the <emphasis>--ancestry-path</emphasis>\r
917 option does. Applied to the <emphasis>D..M</emphasis> range, it results in:</simpara>\r
918 <screen>                E-------F\r
919                  \       \\r
920                   G---H---I---J\r
921                                \\r
922                                 L--M</screen>\r
923 </listitem>\r
924 </varlistentry>\r
925 </variablelist>\r
926 <simpara>The <emphasis>--simplify-by-decoration</emphasis> option allows you to view only the\r
927 big picture of the topology of the history, by omitting commits\r
928 that are not referenced by tags.  Commits are marked as !TREESAME\r
929 (in other words, kept after history simplification rules described\r
930 above) if (1) they are referenced by tags, or (2) they change the\r
931 contents of the paths given on the command line.  All other\r
932 commits are marked as TREESAME (subject to be simplified away).</simpara>\r
933 </section>\r
934 <section id="_commit_ordering">\r
935 <title>Commit Ordering</title>\r
936 <simpara>By default, the commits are shown in reverse chronological order.</simpara>\r
937 <variablelist>\r
938 <varlistentry>\r
939 <term>\r
940 --topo-order\r
941 </term>\r
942 <listitem>\r
943 <simpara>\r
944         This option makes them appear in topological order (i.e.\r
945         descendant commits are shown before their parents).\r
946 </simpara>\r
947 </listitem>\r
948 </varlistentry>\r
949 <varlistentry>\r
950 <term>\r
951 --date-order\r
952 </term>\r
953 <listitem>\r
954 <simpara>\r
955         This option is similar to <emphasis>--topo-order</emphasis> in the sense that no\r
956         parent comes before all of its children, but otherwise things\r
957         are still ordered in the commit timestamp order.\r
958 </simpara>\r
959 </listitem>\r
960 </varlistentry>\r
961 <varlistentry>\r
962 <term>\r
963 --reverse\r
964 </term>\r
965 <listitem>\r
966 <simpara>\r
967         Output the commits in reverse order.\r
968         Cannot be combined with <emphasis>--walk-reflogs</emphasis>.\r
969 </simpara>\r
970 </listitem>\r
971 </varlistentry>\r
972 </variablelist>\r
973 </section>\r
974 <section id="_object_traversal">\r
975 <title>Object Traversal</title>\r
976 <simpara>These options are mostly targeted for packing of git repositories.</simpara>\r
977 <variablelist>\r
978 <varlistentry>\r
979 <term>\r
980 --objects\r
981 </term>\r
982 <listitem>\r
983 <simpara>\r
984         Print the object IDs of any object referenced by the listed\r
985         commits.  <emphasis>--objects foo ^bar</emphasis> thus means "send me\r
986         all object IDs which I need to download if I have the commit\r
987         object <emphasis>bar</emphasis>, but not <emphasis>foo</emphasis>".\r
988 </simpara>\r
989 </listitem>\r
990 </varlistentry>\r
991 <varlistentry>\r
992 <term>\r
993 --objects-edge\r
994 </term>\r
995 <listitem>\r
996 <simpara>\r
997         Similar to <emphasis>--objects</emphasis>, but also print the IDs of excluded\r
998         commits prefixed with a "-" character.  This is used by\r
999         <xref linkend="git-pack-objects(1)" /> to build "thin" pack, which records\r
1000         objects in deltified form based on objects contained in these\r
1001         excluded commits to reduce network traffic.\r
1002 </simpara>\r
1003 </listitem>\r
1004 </varlistentry>\r
1005 <varlistentry>\r
1006 <term>\r
1007 --unpacked\r
1008 </term>\r
1009 <listitem>\r
1010 <simpara>\r
1011         Only useful with <emphasis>--objects</emphasis>; print the object IDs that are not\r
1012         in packs.\r
1013 </simpara>\r
1014 </listitem>\r
1015 </varlistentry>\r
1016 <varlistentry>\r
1017 <term>\r
1018 --no-walk\r
1019 </term>\r
1020 <listitem>\r
1021 <simpara>\r
1022         Only show the given revs, but do not traverse their ancestors.\r
1023 </simpara>\r
1024 </listitem>\r
1025 </varlistentry>\r
1026 <varlistentry>\r
1027 <term>\r
1028 --do-walk\r
1029 </term>\r
1030 <listitem>\r
1031 <simpara>\r
1032         Overrides a previous --no-walk.\r
1033 </simpara>\r
1034 </listitem>\r
1035 </varlistentry>\r
1036 </variablelist>\r
1037 </section>\r
1038 <section id="_commit_formatting">\r
1039 <title>Commit Formatting</title>\r
1040 <variablelist>\r
1041 <varlistentry>\r
1042 <term>\r
1043 --pretty[=&lt;format&gt;]\r
1044 </term>\r
1045 <term>\r
1046 --format=&lt;format&gt;\r
1047 </term>\r
1048 <listitem>\r
1049 <simpara>\r
1050         Pretty-print the contents of the commit logs in a given format,\r
1051         where <emphasis>&lt;format&gt;</emphasis> can be one of <emphasis>oneline</emphasis>, <emphasis>short</emphasis>, <emphasis>medium</emphasis>,\r
1052         <emphasis>full</emphasis>, <emphasis>fuller</emphasis>, <emphasis>email</emphasis>, <emphasis>raw</emphasis> and <emphasis>format:&lt;string&gt;</emphasis>.  See\r
1053         the "PRETTY FORMATS" section for some additional details for each\r
1054         format.  When omitted, the format defaults to <emphasis>medium</emphasis>.\r
1055 </simpara>\r
1056 <simpara>Note: you can specify the default pretty format in the repository\r
1057 configuration (see <xref linkend="git-config(1)" />).</simpara>\r
1058 </listitem>\r
1059 </varlistentry>\r
1060 <varlistentry>\r
1061 <term>\r
1062 --abbrev-commit\r
1063 </term>\r
1064 <listitem>\r
1065 <simpara>\r
1066         Instead of showing the full 40-byte hexadecimal commit object\r
1067         name, show only a partial prefix.  Non default number of\r
1068         digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies\r
1069         diff output, if it is displayed).\r
1070 </simpara>\r
1071 <simpara>This should make "--pretty=oneline" a whole lot more readable for\r
1072 people using 80-column terminals.</simpara>\r
1073 </listitem>\r
1074 </varlistentry>\r
1075 <varlistentry>\r
1076 <term>\r
1077 --no-abbrev-commit\r
1078 </term>\r
1079 <listitem>\r
1080 <simpara>\r
1081         Show the full 40-byte hexadecimal commit object name. This negates\r
1082         <emphasis>--abbrev-commit</emphasis> and those options which imply it such as\r
1083         "--oneline". It also overrides the <emphasis>log.abbrevCommit</emphasis> variable.\r
1084 </simpara>\r
1085 </listitem>\r
1086 </varlistentry>\r
1087 <varlistentry>\r
1088 <term>\r
1089 --oneline\r
1090 </term>\r
1091 <listitem>\r
1092 <simpara>\r
1093         This is a shorthand for "--pretty=oneline --abbrev-commit"\r
1094         used together.\r
1095 </simpara>\r
1096 </listitem>\r
1097 </varlistentry>\r
1098 <varlistentry>\r
1099 <term>\r
1100 --encoding[=&lt;encoding&gt;]\r
1101 </term>\r
1102 <listitem>\r
1103 <simpara>\r
1104         The commit objects record the encoding used for the log message\r
1105         in their encoding header; this option can be used to tell the\r
1106         command to re-code the commit log message in the encoding\r
1107         preferred by the user.  For non plumbing commands this\r
1108         defaults to UTF-8.\r
1109 </simpara>\r
1110 </listitem>\r
1111 </varlistentry>\r
1112 <varlistentry>\r
1113 <term>\r
1114 --notes[=&lt;ref&gt;]\r
1115 </term>\r
1116 <listitem>\r
1117 <simpara>\r
1118         Show the notes (see <xref linkend="git-notes(1)" />) that annotate the\r
1119         commit, when showing the commit log message.  This is the default\r
1120         for <emphasis>git log</emphasis>, <emphasis>git show</emphasis> and <emphasis>git whatchanged</emphasis> commands when\r
1121         there is no <emphasis>--pretty</emphasis>, <emphasis>--format</emphasis> nor <emphasis>--oneline</emphasis> option given\r
1122         on the command line.\r
1123 </simpara>\r
1124 <simpara>By default, the notes shown are from the notes refs listed in the\r
1125 <emphasis>core.notesRef</emphasis> and <emphasis>notes.displayRef</emphasis> variables (or corresponding\r
1126 environment overrides). See <xref linkend="git-config(1)" /> for more details.</simpara>\r
1127 <simpara>With an optional <emphasis>&lt;ref&gt;</emphasis> argument, show this notes ref instead of the\r
1128 default notes ref(s). The ref is taken to be in <emphasis>refs/notes/</emphasis> if it\r
1129 is not qualified.</simpara>\r
1130 <simpara>Multiple --notes options can be combined to control which notes are\r
1131 being displayed. Examples: "--notes=foo" will show only notes from\r
1132 "refs/notes/foo"; "--notes=foo --notes" will show both notes from\r
1133 "refs/notes/foo" and from the default notes ref(s).</simpara>\r
1134 </listitem>\r
1135 </varlistentry>\r
1136 <varlistentry>\r
1137 <term>\r
1138 --no-notes\r
1139 </term>\r
1140 <listitem>\r
1141 <simpara>\r
1142         Do not show notes. This negates the above <emphasis>--notes</emphasis> option, by\r
1143         resetting the list of notes refs from which notes are shown.\r
1144         Options are parsed in the order given on the command line, so e.g.\r
1145         "--notes --notes=foo --no-notes --notes=bar" will only show notes\r
1146         from "refs/notes/bar".\r
1147 </simpara>\r
1148 </listitem>\r
1149 </varlistentry>\r
1150 <varlistentry>\r
1151 <term>\r
1152 --show-notes[=&lt;ref&gt;]\r
1153 </term>\r
1154 <term>\r
1155 --[no-]standard-notes\r
1156 </term>\r
1157 <listitem>\r
1158 <simpara>\r
1159         These options are deprecated. Use the above --notes/--no-notes\r
1160         options instead.\r
1161 </simpara>\r
1162 </listitem>\r
1163 </varlistentry>\r
1164 <varlistentry>\r
1165 <term>\r
1166 --relative-date\r
1167 </term>\r
1168 <listitem>\r
1169 <simpara>\r
1170         Synonym for <emphasis>--date=relative</emphasis>.\r
1171 </simpara>\r
1172 </listitem>\r
1173 </varlistentry>\r
1174 <varlistentry>\r
1175 <term>\r
1176 --date=(relative|local|default|iso|rfc|short|raw)\r
1177 </term>\r
1178 <listitem>\r
1179 <simpara>\r
1180         Only takes effect for dates shown in human-readable format, such\r
1181         as when using "--pretty". <emphasis>log.date</emphasis> config variable sets a default\r
1182         value for log command's --date option.\r
1183 </simpara>\r
1184 <simpara><emphasis>--date=relative</emphasis> shows dates relative to the current time,\r
1185 e.g. "2 hours ago".</simpara>\r
1186 <simpara><emphasis>--date=local</emphasis> shows timestamps in user's local timezone.</simpara>\r
1187 <simpara><emphasis>--date=iso</emphasis> (or <emphasis>--date=iso8601</emphasis>) shows timestamps in ISO 8601 format.</simpara>\r
1188 <simpara><emphasis>--date=rfc</emphasis> (or <emphasis>--date=rfc2822</emphasis>) shows timestamps in RFC 2822\r
1189 format, often found in E-mail messages.</simpara>\r
1190 <simpara><emphasis>--date=short</emphasis> shows only date but not time, in <emphasis>YYYY-MM-DD</emphasis> format.</simpara>\r
1191 <simpara><emphasis>--date=raw</emphasis> shows the date in the internal raw git format <emphasis>%s %z</emphasis> format.</simpara>\r
1192 <simpara><emphasis>--date=default</emphasis> shows timestamps in the original timezone\r
1193 (either committer's or author's).</simpara>\r
1194 </listitem>\r
1195 </varlistentry>\r
1196 <varlistentry>\r
1197 <term>\r
1198 --parents\r
1199 </term>\r
1200 <listitem>\r
1201 <simpara>\r
1202         Print also the parents of the commit (in the form "commit parent&#8230;").\r
1203         Also enables parent rewriting, see <emphasis>History Simplification</emphasis> below.\r
1204 </simpara>\r
1205 </listitem>\r
1206 </varlistentry>\r
1207 <varlistentry>\r
1208 <term>\r
1209 --children\r
1210 </term>\r
1211 <listitem>\r
1212 <simpara>\r
1213         Print also the children of the commit (in the form "commit child&#8230;").\r
1214         Also enables parent rewriting, see <emphasis>History Simplification</emphasis> below.\r
1215 </simpara>\r
1216 </listitem>\r
1217 </varlistentry>\r
1218 <varlistentry>\r
1219 <term>\r
1220 --left-right\r
1221 </term>\r
1222 <listitem>\r
1223 <simpara>\r
1224         Mark which side of a symmetric diff a commit is reachable from.\r
1225         Commits from the left side are prefixed with <emphasis>&lt;</emphasis> and those from\r
1226         the right with <emphasis>&gt;</emphasis>.  If combined with <emphasis>--boundary</emphasis>, those\r
1227         commits are prefixed with <emphasis>-</emphasis>.\r
1228 </simpara>\r
1229 <simpara>For example, if you have this topology:</simpara>\r
1230 <screen>             y---b---b  branch B\r
1231             / \ /\r
1232            /   .\r
1233           /   / \\r
1234          o---x---a---a  branch A</screen>\r
1235 <simpara>you would get an output like this:</simpara>\r
1236 <screen>        $ git rev-list --left-right --boundary --pretty=oneline A...B\r
1238         &gt;bbbbbbb... 3rd on b\r
1239         &gt;bbbbbbb... 2nd on b\r
1240         &lt;aaaaaaa... 3rd on a\r
1241         &lt;aaaaaaa... 2nd on a\r
1242         -yyyyyyy... 1st on b\r
1243         -xxxxxxx... 1st on a</screen>\r
1244 </listitem>\r
1245 </varlistentry>\r
1246 <varlistentry>\r
1247 <term>\r
1248 --graph\r
1249 </term>\r
1250 <listitem>\r
1251 <simpara>\r
1252         Draw a text-based graphical representation of the commit history\r
1253         on the left hand side of the output.  This may cause extra lines\r
1254         to be printed in between commits, in order for the graph history\r
1255         to be drawn properly.\r
1256 </simpara>\r
1257 <simpara>This enables parent rewriting, see <emphasis>History Simplification</emphasis> below.</simpara>\r
1258 <simpara>This implies the <emphasis>--topo-order</emphasis> option by default, but the\r
1259 <emphasis>--date-order</emphasis> option may also be specified.</simpara>\r
1260 </listitem>\r
1261 </varlistentry>\r
1262 </variablelist>\r
1263 </section>\r
1264 <section id="_diff_formatting">\r
1265 <title>Diff Formatting</title>\r
1266 <simpara>Below are listed options that control the formatting of diff output.\r
1267 Some of them are specific to <xref linkend="git-rev-list(1)" />, however other diff\r
1268 options may be given. See <xref linkend="git-diff-files(1)" /> for more options.</simpara>\r
1269 <variablelist>\r
1270 <varlistentry>\r
1271 <term>\r
1272 -c\r
1273 </term>\r
1274 <listitem>\r
1275 <simpara>\r
1276         With this option, diff output for a merge commit\r
1277         shows the differences from each of the parents to the merge result\r
1278         simultaneously instead of showing pairwise diff between a parent\r
1279         and the result one at a time. Furthermore, it lists only files\r
1280         which were modified from all parents.\r
1281 </simpara>\r
1282 </listitem>\r
1283 </varlistentry>\r
1284 <varlistentry>\r
1285 <term>\r
1286 --cc\r
1287 </term>\r
1288 <listitem>\r
1289 <simpara>\r
1290         This flag implies the <emphasis>-c</emphasis> options and further compresses the\r
1291         patch output by omitting uninteresting hunks whose contents in\r
1292         the parents have only two variants and the merge result picks\r
1293         one of them without modification.\r
1294 </simpara>\r
1295 </listitem>\r
1296 </varlistentry>\r
1297 <varlistentry>\r
1298 <term>\r
1299 -m\r
1300 </term>\r
1301 <listitem>\r
1302 <simpara>\r
1303         This flag makes the merge commits show the full diff like\r
1304         regular commits; for each merge parent, a separate log entry\r
1305         and diff is generated. An exception is that only diff against\r
1306         the first parent is shown when <emphasis>--first-parent</emphasis> option is given;\r
1307         in that case, the output represents the changes the merge\r
1308         brought <emphasis>into</emphasis> the then-current branch.\r
1309 </simpara>\r
1310 </listitem>\r
1311 </varlistentry>\r
1312 <varlistentry>\r
1313 <term>\r
1314 -r\r
1315 </term>\r
1316 <listitem>\r
1317 <simpara>\r
1318         Show recursive diffs.\r
1319 </simpara>\r
1320 </listitem>\r
1321 </varlistentry>\r
1322 <varlistentry>\r
1323 <term>\r
1324 -t\r
1325 </term>\r
1326 <listitem>\r
1327 <simpara>\r
1328         Show the tree objects in the diff output. This implies <emphasis>-r</emphasis>.\r
1329 </simpara>\r
1330 </listitem>\r
1331 </varlistentry>\r
1332 <varlistentry>\r
1333 <term>\r
1334 -s\r
1335 </term>\r
1336 <listitem>\r
1337 <simpara>\r
1338         Suppress diff output.\r
1339 </simpara>\r
1340 </listitem>\r
1341 </varlistentry>\r
1342 </variablelist>\r
1343 </section>\r
1344 </simplesect>\r
1345 <simplesect id="_pretty_formats">\r
1346 <title>PRETTY FORMATS</title>\r
1347 <simpara>If the commit is a merge, and if the pretty-format\r
1348 is not <emphasis>oneline</emphasis>, <emphasis>email</emphasis> or <emphasis>raw</emphasis>, an additional line is\r
1349 inserted before the <emphasis>Author:</emphasis> line.  This line begins with\r
1350 "Merge: " and the sha1s of ancestral commits are printed,\r
1351 separated by spaces.  Note that the listed commits may not\r
1352 necessarily be the list of the <emphasis role="strong">direct</emphasis> parent commits if you\r
1353 have limited your view of history: for example, if you are\r
1354 only interested in changes related to a certain directory or\r
1355 file.</simpara>\r
1356 <simpara>There are several built-in formats, and you can define\r
1357 additional formats by setting a pretty.&lt;name&gt;\r
1358 config option to either another format name, or a\r
1359 <emphasis>format:</emphasis> string, as described below (see\r
1360 <xref linkend="git-config(1)" />). Here are the details of the\r
1361 built-in formats:</simpara>\r
1362 <itemizedlist>\r
1363 <listitem>\r
1364 <simpara>\r
1365 <emphasis>oneline</emphasis>\r
1366 </simpara>\r
1367 <literallayout class="monospaced">&lt;sha1&gt; &lt;title line&gt;</literallayout>\r
1368 <simpara>This is designed to be as compact as possible.</simpara>\r
1369 </listitem>\r
1370 <listitem>\r
1371 <simpara>\r
1372 <emphasis>short</emphasis>\r
1373 </simpara>\r
1374 <literallayout class="monospaced">commit &lt;sha1&gt;\r
1375 Author: &lt;author&gt;</literallayout>\r
1376 <literallayout class="monospaced">&lt;title line&gt;</literallayout>\r
1377 </listitem>\r
1378 <listitem>\r
1379 <simpara>\r
1380 <emphasis>medium</emphasis>\r
1381 </simpara>\r
1382 <literallayout class="monospaced">commit &lt;sha1&gt;\r
1383 Author: &lt;author&gt;\r
1384 Date:   &lt;author date&gt;</literallayout>\r
1385 <literallayout class="monospaced">&lt;title line&gt;</literallayout>\r
1386 <literallayout class="monospaced">&lt;full commit message&gt;</literallayout>\r
1387 </listitem>\r
1388 <listitem>\r
1389 <simpara>\r
1390 <emphasis>full</emphasis>\r
1391 </simpara>\r
1392 <literallayout class="monospaced">commit &lt;sha1&gt;\r
1393 Author: &lt;author&gt;\r
1394 Commit: &lt;committer&gt;</literallayout>\r
1395 <literallayout class="monospaced">&lt;title line&gt;</literallayout>\r
1396 <literallayout class="monospaced">&lt;full commit message&gt;</literallayout>\r
1397 </listitem>\r
1398 <listitem>\r
1399 <simpara>\r
1400 <emphasis>fuller</emphasis>\r
1401 </simpara>\r
1402 <literallayout class="monospaced">commit &lt;sha1&gt;\r
1403 Author:     &lt;author&gt;\r
1404 AuthorDate: &lt;author date&gt;\r
1405 Commit:     &lt;committer&gt;\r
1406 CommitDate: &lt;committer date&gt;</literallayout>\r
1407 <literallayout class="monospaced">&lt;title line&gt;</literallayout>\r
1408 <literallayout class="monospaced">&lt;full commit message&gt;</literallayout>\r
1409 </listitem>\r
1410 <listitem>\r
1411 <simpara>\r
1412 <emphasis>email</emphasis>\r
1413 </simpara>\r
1414 <literallayout class="monospaced">From &lt;sha1&gt; &lt;date&gt;\r
1415 From: &lt;author&gt;\r
1416 Date: &lt;author date&gt;\r
1417 Subject: [PATCH] &lt;title line&gt;</literallayout>\r
1418 <literallayout class="monospaced">&lt;full commit message&gt;</literallayout>\r
1419 </listitem>\r
1420 <listitem>\r
1421 <simpara>\r
1422 <emphasis>raw</emphasis>\r
1423 </simpara>\r
1424 <simpara>The <emphasis>raw</emphasis> format shows the entire commit exactly as\r
1425 stored in the commit object.  Notably, the SHA1s are\r
1426 displayed in full, regardless of whether --abbrev or\r
1427 --no-abbrev are used, and <emphasis>parents</emphasis> information show the\r
1428 true parent commits, without taking grafts nor history\r
1429 simplification into account.</simpara>\r
1430 </listitem>\r
1431 <listitem>\r
1432 <simpara>\r
1433 <emphasis>format:&lt;string&gt;</emphasis>\r
1434 </simpara>\r
1435 <simpara>The <emphasis>format:&lt;string&gt;</emphasis> format allows you to specify which information\r
1436 you want to show. It works a little bit like printf format,\r
1437 with the notable exception that you get a newline with <emphasis>%n</emphasis>\r
1438 instead of <emphasis>\n</emphasis>.</simpara>\r
1439 <simpara>E.g, <emphasis>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</emphasis>\r
1440 would show something like this:</simpara>\r
1441 <screen>The author of fe6e0ee was Junio C Hamano, 23 hours ago\r
1442 The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</screen>\r
1443 <simpara>The placeholders are:</simpara>\r
1444 <itemizedlist>\r
1445 <listitem>\r
1446 <simpara>\r
1447 <emphasis>%H</emphasis>: commit hash\r
1448 </simpara>\r
1449 </listitem>\r
1450 <listitem>\r
1451 <simpara>\r
1452 <emphasis>%h</emphasis>: abbreviated commit hash\r
1453 </simpara>\r
1454 </listitem>\r
1455 <listitem>\r
1456 <simpara>\r
1457 <emphasis>%T</emphasis>: tree hash\r
1458 </simpara>\r
1459 </listitem>\r
1460 <listitem>\r
1461 <simpara>\r
1462 <emphasis>%t</emphasis>: abbreviated tree hash\r
1463 </simpara>\r
1464 </listitem>\r
1465 <listitem>\r
1466 <simpara>\r
1467 <emphasis>%P</emphasis>: parent hashes\r
1468 </simpara>\r
1469 </listitem>\r
1470 <listitem>\r
1471 <simpara>\r
1472 <emphasis>%p</emphasis>: abbreviated parent hashes\r
1473 </simpara>\r
1474 </listitem>\r
1475 <listitem>\r
1476 <simpara>\r
1477 <emphasis>%an</emphasis>: author name\r
1478 </simpara>\r
1479 </listitem>\r
1480 <listitem>\r
1481 <simpara>\r
1482 <emphasis>%aN</emphasis>: author name (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
1483 </simpara>\r
1484 </listitem>\r
1485 <listitem>\r
1486 <simpara>\r
1487 <emphasis>%ae</emphasis>: author email\r
1488 </simpara>\r
1489 </listitem>\r
1490 <listitem>\r
1491 <simpara>\r
1492 <emphasis>%aE</emphasis>: author email (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
1493 </simpara>\r
1494 </listitem>\r
1495 <listitem>\r
1496 <simpara>\r
1497 <emphasis>%ad</emphasis>: author date (format respects --date= option)\r
1498 </simpara>\r
1499 </listitem>\r
1500 <listitem>\r
1501 <simpara>\r
1502 <emphasis>%aD</emphasis>: author date, RFC2822 style\r
1503 </simpara>\r
1504 </listitem>\r
1505 <listitem>\r
1506 <simpara>\r
1507 <emphasis>%ar</emphasis>: author date, relative\r
1508 </simpara>\r
1509 </listitem>\r
1510 <listitem>\r
1511 <simpara>\r
1512 <emphasis>%at</emphasis>: author date, UNIX timestamp\r
1513 </simpara>\r
1514 </listitem>\r
1515 <listitem>\r
1516 <simpara>\r
1517 <emphasis>%ai</emphasis>: author date, ISO 8601 format\r
1518 </simpara>\r
1519 </listitem>\r
1520 <listitem>\r
1521 <simpara>\r
1522 <emphasis>%cn</emphasis>: committer name\r
1523 </simpara>\r
1524 </listitem>\r
1525 <listitem>\r
1526 <simpara>\r
1527 <emphasis>%cN</emphasis>: committer name (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
1528 </simpara>\r
1529 </listitem>\r
1530 <listitem>\r
1531 <simpara>\r
1532 <emphasis>%ce</emphasis>: committer email\r
1533 </simpara>\r
1534 </listitem>\r
1535 <listitem>\r
1536 <simpara>\r
1537 <emphasis>%cE</emphasis>: committer email (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
1538 </simpara>\r
1539 </listitem>\r
1540 <listitem>\r
1541 <simpara>\r
1542 <emphasis>%cd</emphasis>: committer date\r
1543 </simpara>\r
1544 </listitem>\r
1545 <listitem>\r
1546 <simpara>\r
1547 <emphasis>%cD</emphasis>: committer date, RFC2822 style\r
1548 </simpara>\r
1549 </listitem>\r
1550 <listitem>\r
1551 <simpara>\r
1552 <emphasis>%cr</emphasis>: committer date, relative\r
1553 </simpara>\r
1554 </listitem>\r
1555 <listitem>\r
1556 <simpara>\r
1557 <emphasis>%ct</emphasis>: committer date, UNIX timestamp\r
1558 </simpara>\r
1559 </listitem>\r
1560 <listitem>\r
1561 <simpara>\r
1562 <emphasis>%ci</emphasis>: committer date, ISO 8601 format\r
1563 </simpara>\r
1564 </listitem>\r
1565 <listitem>\r
1566 <simpara>\r
1567 <emphasis>%d</emphasis>: ref names, like the --decorate option of <xref linkend="git-log(1)" />\r
1568 </simpara>\r
1569 </listitem>\r
1570 <listitem>\r
1571 <simpara>\r
1572 <emphasis>%e</emphasis>: encoding\r
1573 </simpara>\r
1574 </listitem>\r
1575 <listitem>\r
1576 <simpara>\r
1577 <emphasis>%s</emphasis>: subject\r
1578 </simpara>\r
1579 </listitem>\r
1580 <listitem>\r
1581 <simpara>\r
1582 <emphasis>%f</emphasis>: sanitized subject line, suitable for a filename\r
1583 </simpara>\r
1584 </listitem>\r
1585 <listitem>\r
1586 <simpara>\r
1587 <emphasis>%b</emphasis>: body\r
1588 </simpara>\r
1589 </listitem>\r
1590 <listitem>\r
1591 <simpara>\r
1592 <emphasis>%B</emphasis>: raw body (unwrapped subject and body)\r
1593 </simpara>\r
1594 </listitem>\r
1595 <listitem>\r
1596 <simpara>\r
1597 <emphasis>%N</emphasis>: commit notes\r
1598 </simpara>\r
1599 </listitem>\r
1600 <listitem>\r
1601 <simpara>\r
1602 <emphasis>%gD</emphasis>: reflog selector, e.g., <emphasis>refs/stash@{1}</emphasis>\r
1603 </simpara>\r
1604 </listitem>\r
1605 <listitem>\r
1606 <simpara>\r
1607 <emphasis>%gd</emphasis>: shortened reflog selector, e.g., <emphasis>stash@{1}</emphasis>\r
1608 </simpara>\r
1609 </listitem>\r
1610 <listitem>\r
1611 <simpara>\r
1612 <emphasis>%gn</emphasis>: reflog identity name\r
1613 </simpara>\r
1614 </listitem>\r
1615 <listitem>\r
1616 <simpara>\r
1617 <emphasis>%gN</emphasis>: reflog identity name (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
1618 </simpara>\r
1619 </listitem>\r
1620 <listitem>\r
1621 <simpara>\r
1622 <emphasis>%ge</emphasis>: reflog identity email\r
1623 </simpara>\r
1624 </listitem>\r
1625 <listitem>\r
1626 <simpara>\r
1627 <emphasis>%gE</emphasis>: reflog identity email (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
1628 </simpara>\r
1629 </listitem>\r
1630 <listitem>\r
1631 <simpara>\r
1632 <emphasis>%gs</emphasis>: reflog subject\r
1633 </simpara>\r
1634 </listitem>\r
1635 <listitem>\r
1636 <simpara>\r
1637 <emphasis>%Cred</emphasis>: switch color to red\r
1638 </simpara>\r
1639 </listitem>\r
1640 <listitem>\r
1641 <simpara>\r
1642 <emphasis>%Cgreen</emphasis>: switch color to green\r
1643 </simpara>\r
1644 </listitem>\r
1645 <listitem>\r
1646 <simpara>\r
1647 <emphasis>%Cblue</emphasis>: switch color to blue\r
1648 </simpara>\r
1649 </listitem>\r
1650 <listitem>\r
1651 <simpara>\r
1652 <emphasis>%Creset</emphasis>: reset color\r
1653 </simpara>\r
1654 </listitem>\r
1655 <listitem>\r
1656 <simpara>\r
1657 <emphasis>%C(&#8230;)</emphasis>: color specification, as described in color.branch.* config option\r
1658 </simpara>\r
1659 </listitem>\r
1660 <listitem>\r
1661 <simpara>\r
1662 <emphasis>%m</emphasis>: left, right or boundary mark\r
1663 </simpara>\r
1664 </listitem>\r
1665 <listitem>\r
1666 <simpara>\r
1667 <emphasis>%n</emphasis>: newline\r
1668 </simpara>\r
1669 </listitem>\r
1670 <listitem>\r
1671 <simpara>\r
1672 <emphasis>%%</emphasis>: a raw <emphasis>%</emphasis>\r
1673 </simpara>\r
1674 </listitem>\r
1675 <listitem>\r
1676 <simpara>\r
1677 <emphasis>%x00</emphasis>: print a byte from a hex code\r
1678 </simpara>\r
1679 </listitem>\r
1680 <listitem>\r
1681 <simpara>\r
1682 <emphasis>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</emphasis>: switch line wrapping, like the -w option of\r
1683   <xref linkend="git-shortlog(1)" />.\r
1684 </simpara>\r
1685 </listitem>\r
1686 </itemizedlist>\r
1687 </listitem>\r
1688 </itemizedlist>\r
1689 <note><simpara>Some placeholders may depend on other options given to the\r
1690 revision traversal engine. For example, the <emphasis>%g*</emphasis> reflog options will\r
1691 insert an empty string unless we are traversing reflog entries (e.g., by\r
1692 <emphasis>git log -g</emphasis>). The <emphasis>%d</emphasis> placeholder will use the "short" decoration\r
1693 format if <emphasis>--decorate</emphasis> was not already provided on the command line.</simpara></note>\r
1694 <simpara>If you add a <emphasis>+</emphasis> (plus sign) after <emphasis>%</emphasis> of a placeholder, a line-feed\r
1695 is inserted immediately before the expansion if and only if the\r
1696 placeholder expands to a non-empty string.</simpara>\r
1697 <simpara>If you add a <emphasis>-</emphasis> (minus sign) after <emphasis>%</emphasis> of a placeholder, line-feeds that\r
1698 immediately precede the expansion are deleted if and only if the\r
1699 placeholder expands to an empty string.</simpara>\r
1700 <simpara>If you add a ` ` (space) after <emphasis>%</emphasis> of a placeholder, a space\r
1701 is inserted immediately before the expansion if and only if the\r
1702 placeholder expands to a non-empty string.</simpara>\r
1703 <itemizedlist>\r
1704 <listitem>\r
1705 <simpara>\r
1706 <emphasis>tformat:</emphasis>\r
1707 </simpara>\r
1708 <simpara>The <emphasis>tformat:</emphasis> format works exactly like <emphasis>format:</emphasis>, except that it\r
1709 provides "terminator" semantics instead of "separator" semantics. In\r
1710 other words, each commit has the message terminator character (usually a\r
1711 newline) appended, rather than a separator placed between entries.\r
1712 This means that the final entry of a single-line format will be properly\r
1713 terminated with a new line, just as the "oneline" format does.\r
1714 For example:</simpara>\r
1715 <screen>$ git log -2 --pretty=format:%h 4da45bef \\r
1716   | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'\r
1717 4da45be\r
1718 7134973 -- NO NEWLINE\r
1720 $ git log -2 --pretty=tformat:%h 4da45bef \\r
1721   | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'\r
1722 4da45be\r
1723 7134973</screen>\r
1724 <simpara>In addition, any unrecognized string that has a <emphasis>%</emphasis> in it is interpreted\r
1725 as if it has <emphasis>tformat:</emphasis> in front of it.  For example, these two are\r
1726 equivalent:</simpara>\r
1727 <screen>$ git log -2 --pretty=tformat:%h 4da45bef\r
1728 $ git log -2 --pretty=%h 4da45bef</screen>\r
1729 </listitem>\r
1730 </itemizedlist>\r
1731 </simplesect>\r
1732 <simplesect id="_common_diff_options">\r
1733 <title>Common diff options</title>\r
1734 <variablelist>\r
1735 <varlistentry>\r
1736 <term>\r
1737 -p\r
1738 </term>\r
1739 <term>\r
1740 -u\r
1741 </term>\r
1742 <term>\r
1743 --patch\r
1744 </term>\r
1745 <listitem>\r
1746 <simpara>\r
1747         Generate patch (see section on generating patches).\r
1748         \r
1749 </simpara>\r
1750 </listitem>\r
1751 </varlistentry>\r
1752 <varlistentry>\r
1753 <term>\r
1754 -U&lt;n&gt;\r
1755 </term>\r
1756 <term>\r
1757 --unified=&lt;n&gt;\r
1758 </term>\r
1759 <listitem>\r
1760 <simpara>\r
1761         Generate diffs with &lt;n&gt; lines of context instead of\r
1762         the usual three.\r
1763         Implies <emphasis>-p</emphasis>.\r
1764 </simpara>\r
1765 </listitem>\r
1766 </varlistentry>\r
1767 <varlistentry>\r
1768 <term>\r
1769 --raw\r
1770 </term>\r
1771 <listitem>\r
1772 <simpara>\r
1773         Generate the raw format.\r
1774         \r
1775 </simpara>\r
1776 </listitem>\r
1777 </varlistentry>\r
1778 <varlistentry>\r
1779 <term>\r
1780 --patch-with-raw\r
1781 </term>\r
1782 <listitem>\r
1783 <simpara>\r
1784         Synonym for <emphasis>-p --raw</emphasis>.\r
1785 </simpara>\r
1786 </listitem>\r
1787 </varlistentry>\r
1788 <varlistentry>\r
1789 <term>\r
1790 --minimal\r
1791 </term>\r
1792 <listitem>\r
1793 <simpara>\r
1794         Spend extra time to make sure the smallest possible\r
1795         diff is produced.\r
1796 </simpara>\r
1797 </listitem>\r
1798 </varlistentry>\r
1799 <varlistentry>\r
1800 <term>\r
1801 --patience\r
1802 </term>\r
1803 <listitem>\r
1804 <simpara>\r
1805         Generate a diff using the "patience diff" algorithm.\r
1806 </simpara>\r
1807 </listitem>\r
1808 </varlistentry>\r
1809 <varlistentry>\r
1810 <term>\r
1811 --histogram\r
1812 </term>\r
1813 <listitem>\r
1814 <simpara>\r
1815         Generate a diff using the "histogram diff" algorithm.\r
1816 </simpara>\r
1817 </listitem>\r
1818 </varlistentry>\r
1819 <varlistentry>\r
1820 <term>\r
1821 --stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]\r
1822 </term>\r
1823 <listitem>\r
1824 <simpara>\r
1825         Generate a diffstat. By default, as much space as necessary\r
1826         will be used for the filename part, and the rest for the graph\r
1827         part. Maximum width defaults to terminal width, or 80 columns\r
1828         if not connected to a terminal, and can be overriden by\r
1829         <emphasis>&lt;width&gt;</emphasis>. The width of the filename part can be limited by\r
1830         giving another width <emphasis>&lt;name-width&gt;</emphasis> after a comma. The width\r
1831         of the graph part can be limited by using\r
1832         <emphasis>--stat-graph-width=&lt;width&gt;</emphasis> (affects all commands generating\r
1833         a stat graph) or by setting <emphasis>diff.statGraphWidth=&lt;width&gt;</emphasis>\r
1834         (does not affect <emphasis>git format-patch</emphasis>).\r
1835         By giving a third parameter <emphasis>&lt;count&gt;</emphasis>, you can limit the\r
1836         output to the first <emphasis>&lt;count&gt;</emphasis> lines, followed by <emphasis>...</emphasis> if\r
1837         there are more.\r
1838 </simpara>\r
1839 <simpara>These parameters can also be set individually with <emphasis>--stat-width=&lt;width&gt;</emphasis>,\r
1840 <emphasis>--stat-name-width=&lt;name-width&gt;</emphasis> and <emphasis>--stat-count=&lt;count&gt;</emphasis>.</simpara>\r
1841 </listitem>\r
1842 </varlistentry>\r
1843 <varlistentry>\r
1844 <term>\r
1845 --numstat\r
1846 </term>\r
1847 <listitem>\r
1848 <simpara>\r
1849         Similar to <emphasis>--stat</emphasis>, but shows number of added and\r
1850         deleted lines in decimal notation and pathname without\r
1851         abbreviation, to make it more machine friendly.  For\r
1852         binary files, outputs two <emphasis>-</emphasis> instead of saying\r
1853         <emphasis>0 0</emphasis>.\r
1854 </simpara>\r
1855 </listitem>\r
1856 </varlistentry>\r
1857 <varlistentry>\r
1858 <term>\r
1859 --shortstat\r
1860 </term>\r
1861 <listitem>\r
1862 <simpara>\r
1863         Output only the last line of the <emphasis>--stat</emphasis> format containing total\r
1864         number of modified files, as well as number of added and deleted\r
1865         lines.\r
1866 </simpara>\r
1867 </listitem>\r
1868 </varlistentry>\r
1869 <varlistentry>\r
1870 <term>\r
1871 --dirstat[=&lt;param1,param2,&#8230;&gt;]\r
1872 </term>\r
1873 <listitem>\r
1874 <simpara>\r
1875         Output the distribution of relative amount of changes for each\r
1876         sub-directory. The behavior of <emphasis>--dirstat</emphasis> can be customized by\r
1877         passing it a comma separated list of parameters.\r
1878         The defaults are controlled by the <emphasis>diff.dirstat</emphasis> configuration\r
1879         variable (see <xref linkend="git-config(1)" />).\r
1880         The following parameters are available:\r
1881 </simpara>\r
1882 <variablelist>\r
1883 <varlistentry>\r
1884 <term>\r
1885 <emphasis>changes</emphasis>\r
1886 </term>\r
1887 <listitem>\r
1888 <simpara>\r
1889         Compute the dirstat numbers by counting the lines that have been\r
1890         removed from the source, or added to the destination. This ignores\r
1891         the amount of pure code movements within a file.  In other words,\r
1892         rearranging lines in a file is not counted as much as other changes.\r
1893         This is the default behavior when no parameter is given.\r
1894 </simpara>\r
1895 </listitem>\r
1896 </varlistentry>\r
1897 <varlistentry>\r
1898 <term>\r
1899 <emphasis>lines</emphasis>\r
1900 </term>\r
1901 <listitem>\r
1902 <simpara>\r
1903         Compute the dirstat numbers by doing the regular line-based diff\r
1904         analysis, and summing the removed/added line counts. (For binary\r
1905         files, count 64-byte chunks instead, since binary files have no\r
1906         natural concept of lines). This is a more expensive <emphasis>--dirstat</emphasis>\r
1907         behavior than the <emphasis>changes</emphasis> behavior, but it does count rearranged\r
1908         lines within a file as much as other changes. The resulting output\r
1909         is consistent with what you get from the other <emphasis>--*stat</emphasis> options.\r
1910 </simpara>\r
1911 </listitem>\r
1912 </varlistentry>\r
1913 <varlistentry>\r
1914 <term>\r
1915 <emphasis>files</emphasis>\r
1916 </term>\r
1917 <listitem>\r
1918 <simpara>\r
1919         Compute the dirstat numbers by counting the number of files changed.\r
1920         Each changed file counts equally in the dirstat analysis. This is\r
1921         the computationally cheapest <emphasis>--dirstat</emphasis> behavior, since it does\r
1922         not have to look at the file contents at all.\r
1923 </simpara>\r
1924 </listitem>\r
1925 </varlistentry>\r
1926 <varlistentry>\r
1927 <term>\r
1928 <emphasis>cumulative</emphasis>\r
1929 </term>\r
1930 <listitem>\r
1931 <simpara>\r
1932         Count changes in a child directory for the parent directory as well.\r
1933         Note that when using <emphasis>cumulative</emphasis>, the sum of the percentages\r
1934         reported may exceed 100%. The default (non-cumulative) behavior can\r
1935         be specified with the <emphasis>noncumulative</emphasis> parameter.\r
1936 </simpara>\r
1937 </listitem>\r
1938 </varlistentry>\r
1939 <varlistentry>\r
1940 <term>\r
1941 &lt;limit&gt;\r
1942 </term>\r
1943 <listitem>\r
1944 <simpara>\r
1945         An integer parameter specifies a cut-off percent (3% by default).\r
1946         Directories contributing less than this percentage of the changes\r
1947         are not shown in the output.\r
1948 </simpara>\r
1949 </listitem>\r
1950 </varlistentry>\r
1951 </variablelist>\r
1952 <simpara>Example: The following will count changed files, while ignoring\r
1953 directories with less than 10% of the total amount of changed files,\r
1954 and accumulating child directory counts in the parent directories:\r
1955 <emphasis>--dirstat=files,10,cumulative</emphasis>.</simpara>\r
1956 </listitem>\r
1957 </varlistentry>\r
1958 <varlistentry>\r
1959 <term>\r
1960 --summary\r
1961 </term>\r
1962 <listitem>\r
1963 <simpara>\r
1964         Output a condensed summary of extended header information\r
1965         such as creations, renames and mode changes.\r
1966 </simpara>\r
1967 </listitem>\r
1968 </varlistentry>\r
1969 <varlistentry>\r
1970 <term>\r
1971 --patch-with-stat\r
1972 </term>\r
1973 <listitem>\r
1974 <simpara>\r
1975         Synonym for <emphasis>-p --stat</emphasis>.\r
1976 </simpara>\r
1977 </listitem>\r
1978 </varlistentry>\r
1979 <varlistentry>\r
1980 <term>\r
1981 -z\r
1982 </term>\r
1983 <listitem>\r
1984 <simpara>\r
1985         Separate the commits with NULs instead of with new newlines.\r
1986 </simpara>\r
1987 <simpara>Also, when <emphasis>--raw</emphasis> or <emphasis>--numstat</emphasis> has been given, do not munge\r
1988 pathnames and use NULs as output field terminators.</simpara>\r
1989 <simpara>Without this option, each pathname output will have TAB, LF, double quotes,\r
1990 and backslash characters replaced with <emphasis>\t</emphasis>, <emphasis>\n</emphasis>, <emphasis>\"</emphasis>, and <emphasis>\\</emphasis>,\r
1991 respectively, and the pathname will be enclosed in double quotes if\r
1992 any of those replacements occurred.</simpara>\r
1993 </listitem>\r
1994 </varlistentry>\r
1995 <varlistentry>\r
1996 <term>\r
1997 --name-only\r
1998 </term>\r
1999 <listitem>\r
2000 <simpara>\r
2001         Show only names of changed files.\r
2002 </simpara>\r
2003 </listitem>\r
2004 </varlistentry>\r
2005 <varlistentry>\r
2006 <term>\r
2007 --name-status\r
2008 </term>\r
2009 <listitem>\r
2010 <simpara>\r
2011         Show only names and status of changed files. See the description\r
2012         of the <emphasis>--diff-filter</emphasis> option on what the status letters mean.\r
2013 </simpara>\r
2014 </listitem>\r
2015 </varlistentry>\r
2016 <varlistentry>\r
2017 <term>\r
2018 --submodule[=&lt;format&gt;]\r
2019 </term>\r
2020 <listitem>\r
2021 <simpara>\r
2022         Specify how differences in submodules are shown.  When <emphasis>--submodule</emphasis>\r
2023         or <emphasis>--submodule=log</emphasis> is given, the <emphasis>log</emphasis> format is used.  This format lists\r
2024         the commits in the range like <xref linkend="git-submodule(1)" /> <emphasis>summary</emphasis> does.\r
2025         Omitting the <emphasis>--submodule</emphasis> option or specifying <emphasis>--submodule=short</emphasis>,\r
2026         uses the <emphasis>short</emphasis> format. This format just shows the names of the commits\r
2027         at the beginning and end of the range.\r
2028 </simpara>\r
2029 </listitem>\r
2030 </varlistentry>\r
2031 <varlistentry>\r
2032 <term>\r
2033 --color[=&lt;when&gt;]\r
2034 </term>\r
2035 <listitem>\r
2036 <simpara>\r
2037         Show colored diff.\r
2038         The value must be <emphasis>always</emphasis> (the default for <emphasis>&lt;when&gt;</emphasis>), <emphasis>never</emphasis>, or <emphasis>auto</emphasis>.\r
2039         The default value is <emphasis>never</emphasis>.\r
2040 </simpara>\r
2041 </listitem>\r
2042 </varlistentry>\r
2043 <varlistentry>\r
2044 <term>\r
2045 --no-color\r
2046 </term>\r
2047 <listitem>\r
2048 <simpara>\r
2049         Turn off colored diff.\r
2050         It is the same as <emphasis>--color=never</emphasis>.\r
2051 </simpara>\r
2052 </listitem>\r
2053 </varlistentry>\r
2054 <varlistentry>\r
2055 <term>\r
2056 --word-diff[=&lt;mode&gt;]\r
2057 </term>\r
2058 <listitem>\r
2059 <simpara>\r
2060         Show a word diff, using the &lt;mode&gt; to delimit changed words.\r
2061         By default, words are delimited by whitespace; see\r
2062         <emphasis>--word-diff-regex</emphasis> below.  The &lt;mode&gt; defaults to <emphasis>plain</emphasis>, and\r
2063         must be one of:\r
2064 </simpara>\r
2065 <variablelist>\r
2066 <varlistentry>\r
2067 <term>\r
2068 color\r
2069 </term>\r
2070 <listitem>\r
2071 <simpara>\r
2072         Highlight changed words using only colors.  Implies <emphasis>--color</emphasis>.\r
2073 </simpara>\r
2074 </listitem>\r
2075 </varlistentry>\r
2076 <varlistentry>\r
2077 <term>\r
2078 plain\r
2079 </term>\r
2080 <listitem>\r
2081 <simpara>\r
2082         Show words as <emphasis>[-removed-]</emphasis> and <emphasis>{+added+}</emphasis>.  Makes no\r
2083         attempts to escape the delimiters if they appear in the input,\r
2084         so the output may be ambiguous.\r
2085 </simpara>\r
2086 </listitem>\r
2087 </varlistentry>\r
2088 <varlistentry>\r
2089 <term>\r
2090 porcelain\r
2091 </term>\r
2092 <listitem>\r
2093 <simpara>\r
2094         Use a special line-based format intended for script\r
2095         consumption.  Added/removed/unchanged runs are printed in the\r
2096         usual unified diff format, starting with a <emphasis>+</emphasis>/<emphasis>-</emphasis>/` `\r
2097         character at the beginning of the line and extending to the\r
2098         end of the line.  Newlines in the input are represented by a\r
2099         tilde <emphasis>~</emphasis> on a line of its own.\r
2100 </simpara>\r
2101 </listitem>\r
2102 </varlistentry>\r
2103 <varlistentry>\r
2104 <term>\r
2105 none\r
2106 </term>\r
2107 <listitem>\r
2108 <simpara>\r
2109         Disable word diff again.\r
2110 </simpara>\r
2111 </listitem>\r
2112 </varlistentry>\r
2113 </variablelist>\r
2114 <simpara>Note that despite the name of the first mode, color is used to\r
2115 highlight the changed parts in all modes if enabled.</simpara>\r
2116 </listitem>\r
2117 </varlistentry>\r
2118 <varlistentry>\r
2119 <term>\r
2120 --word-diff-regex=&lt;regex&gt;\r
2121 </term>\r
2122 <listitem>\r
2123 <simpara>\r
2124         Use &lt;regex&gt; to decide what a word is, instead of considering\r
2125         runs of non-whitespace to be a word.  Also implies\r
2126         <emphasis>--word-diff</emphasis> unless it was already enabled.\r
2127 </simpara>\r
2128 <simpara>Every non-overlapping match of the\r
2129 &lt;regex&gt; is considered a word.  Anything between these matches is\r
2130 considered whitespace and ignored(!) for the purposes of finding\r
2131 differences.  You may want to append <emphasis>|[^[:space:]]</emphasis> to your regular\r
2132 expression to make sure that it matches all non-whitespace characters.\r
2133 A match that contains a newline is silently truncated(!) at the\r
2134 newline.</simpara>\r
2135 <simpara>The regex can also be set via a diff driver or configuration option, see\r
2136 <xref linkend="gitattributes(1)" /> or <xref linkend="git-config(1)" />.  Giving it explicitly\r
2137 overrides any diff driver or configuration setting.  Diff drivers\r
2138 override configuration settings.</simpara>\r
2139 </listitem>\r
2140 </varlistentry>\r
2141 <varlistentry>\r
2142 <term>\r
2143 --color-words[=&lt;regex&gt;]\r
2144 </term>\r
2145 <listitem>\r
2146 <simpara>\r
2147         Equivalent to <emphasis>--word-diff=color</emphasis> plus (if a regex was\r
2148         specified) <emphasis>--word-diff-regex=&lt;regex&gt;</emphasis>.\r
2149 </simpara>\r
2150 </listitem>\r
2151 </varlistentry>\r
2152 <varlistentry>\r
2153 <term>\r
2154 --no-renames\r
2155 </term>\r
2156 <listitem>\r
2157 <simpara>\r
2158         Turn off rename detection, even when the configuration\r
2159         file gives the default to do so.\r
2160 </simpara>\r
2161 </listitem>\r
2162 </varlistentry>\r
2163 <varlistentry>\r
2164 <term>\r
2165 --check\r
2166 </term>\r
2167 <listitem>\r
2168 <simpara>\r
2169         Warn if changes introduce whitespace errors.  What are\r
2170         considered whitespace errors is controlled by <emphasis>core.whitespace</emphasis>\r
2171         configuration.  By default, trailing whitespaces (including\r
2172         lines that solely consist of whitespaces) and a space character\r
2173         that is immediately followed by a tab character inside the\r
2174         initial indent of the line are considered whitespace errors.\r
2175         Exits with non-zero status if problems are found. Not compatible\r
2176         with --exit-code.\r
2177 </simpara>\r
2178 </listitem>\r
2179 </varlistentry>\r
2180 <varlistentry>\r
2181 <term>\r
2182 --full-index\r
2183 </term>\r
2184 <listitem>\r
2185 <simpara>\r
2186         Instead of the first handful of characters, show the full\r
2187         pre- and post-image blob object names on the "index"\r
2188         line when generating patch format output.\r
2189 </simpara>\r
2190 </listitem>\r
2191 </varlistentry>\r
2192 <varlistentry>\r
2193 <term>\r
2194 --binary\r
2195 </term>\r
2196 <listitem>\r
2197 <simpara>\r
2198         In addition to <emphasis>--full-index</emphasis>, output a binary diff that\r
2199         can be applied with <emphasis>git-apply</emphasis>.\r
2200 </simpara>\r
2201 </listitem>\r
2202 </varlistentry>\r
2203 <varlistentry>\r
2204 <term>\r
2205 --abbrev[=&lt;n&gt;]\r
2206 </term>\r
2207 <listitem>\r
2208 <simpara>\r
2209         Instead of showing the full 40-byte hexadecimal object\r
2210         name in diff-raw format output and diff-tree header\r
2211         lines, show only a partial prefix.  This is\r
2212         independent of the <emphasis>--full-index</emphasis> option above, which controls\r
2213         the diff-patch output format.  Non default number of\r
2214         digits can be specified with <emphasis>--abbrev=&lt;n&gt;</emphasis>.\r
2215 </simpara>\r
2216 </listitem>\r
2217 </varlistentry>\r
2218 <varlistentry>\r
2219 <term>\r
2220 -B[&lt;n&gt;][/&lt;m&gt;]\r
2221 </term>\r
2222 <term>\r
2223 --break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]\r
2224 </term>\r
2225 <listitem>\r
2226 <simpara>\r
2227         Break complete rewrite changes into pairs of delete and\r
2228         create. This serves two purposes:\r
2229 </simpara>\r
2230 <simpara>It affects the way a change that amounts to a total rewrite of a file\r
2231 not as a series of deletion and insertion mixed together with a very\r
2232 few lines that happen to match textually as the context, but as a\r
2233 single deletion of everything old followed by a single insertion of\r
2234 everything new, and the number <emphasis>m</emphasis> controls this aspect of the -B\r
2235 option (defaults to 60%). <emphasis>-B/70%</emphasis> specifies that less than 30% of the\r
2236 original should remain in the result for git to consider it a total\r
2237 rewrite (i.e. otherwise the resulting patch will be a series of\r
2238 deletion and insertion mixed together with context lines).</simpara>\r
2239 <simpara>When used with -M, a totally-rewritten file is also considered as the\r
2240 source of a rename (usually -M only considers a file that disappeared\r
2241 as the source of a rename), and the number <emphasis>n</emphasis> controls this aspect of\r
2242 the -B option (defaults to 50%). <emphasis>-B20%</emphasis> specifies that a change with\r
2243 addition and deletion compared to 20% or more of the file's size are\r
2244 eligible for being picked up as a possible source of a rename to\r
2245 another file.</simpara>\r
2246 </listitem>\r
2247 </varlistentry>\r
2248 <varlistentry>\r
2249 <term>\r
2250 -M[&lt;n&gt;]\r
2251 </term>\r
2252 <term>\r
2253 --find-renames[=&lt;n&gt;]\r
2254 </term>\r
2255 <listitem>\r
2256 <simpara>\r
2257         If generating diffs, detect and report renames for each commit.\r
2258         For following files across renames while traversing history, see\r
2259         <emphasis>--follow</emphasis>.\r
2260         If <emphasis>n</emphasis> is specified, it is a threshold on the similarity\r
2261         index (i.e. amount of addition/deletions compared to the\r
2262         file's size). For example, <emphasis>-M90%</emphasis> means git should consider a\r
2263         delete/add pair to be a rename if more than 90% of the file\r
2264         hasn't changed.\r
2265 </simpara>\r
2266 </listitem>\r
2267 </varlistentry>\r
2268 <varlistentry>\r
2269 <term>\r
2270 -C[&lt;n&gt;]\r
2271 </term>\r
2272 <term>\r
2273 --find-copies[=&lt;n&gt;]\r
2274 </term>\r
2275 <listitem>\r
2276 <simpara>\r
2277         Detect copies as well as renames.  See also <emphasis>--find-copies-harder</emphasis>.\r
2278         If <emphasis>n</emphasis> is specified, it has the same meaning as for <emphasis>-M&lt;n&gt;</emphasis>.\r
2279 </simpara>\r
2280 </listitem>\r
2281 </varlistentry>\r
2282 <varlistentry>\r
2283 <term>\r
2284 --find-copies-harder\r
2285 </term>\r
2286 <listitem>\r
2287 <simpara>\r
2288         For performance reasons, by default, <emphasis>-C</emphasis> option finds copies only\r
2289         if the original file of the copy was modified in the same\r
2290         changeset.  This flag makes the command\r
2291         inspect unmodified files as candidates for the source of\r
2292         copy.  This is a very expensive operation for large\r
2293         projects, so use it with caution.  Giving more than one\r
2294         <emphasis>-C</emphasis> option has the same effect.\r
2295 </simpara>\r
2296 </listitem>\r
2297 </varlistentry>\r
2298 <varlistentry>\r
2299 <term>\r
2300 -D\r
2301 </term>\r
2302 <term>\r
2303 --irreversible-delete\r
2304 </term>\r
2305 <listitem>\r
2306 <simpara>\r
2307         Omit the preimage for deletes, i.e. print only the header but not\r
2308         the diff between the preimage and <emphasis>/dev/null</emphasis>. The resulting patch\r
2309         is not meant to be applied with <emphasis>patch</emphasis> nor <emphasis>git apply</emphasis>; this is\r
2310         solely for people who want to just concentrate on reviewing the\r
2311         text after the change. In addition, the output obviously lack\r
2312         enough information to apply such a patch in reverse, even manually,\r
2313         hence the name of the option.\r
2314 </simpara>\r
2315 <simpara>When used together with <emphasis>-B</emphasis>, omit also the preimage in the deletion part\r
2316 of a delete/create pair.</simpara>\r
2317 </listitem>\r
2318 </varlistentry>\r
2319 <varlistentry>\r
2320 <term>\r
2321 -l&lt;num&gt;\r
2322 </term>\r
2323 <listitem>\r
2324 <simpara>\r
2325         The <emphasis>-M</emphasis> and <emphasis>-C</emphasis> options require O(n^2) processing time where n\r
2326         is the number of potential rename/copy targets.  This\r
2327         option prevents rename/copy detection from running if\r
2328         the number of rename/copy targets exceeds the specified\r
2329         number.\r
2330 </simpara>\r
2331 </listitem>\r
2332 </varlistentry>\r
2333 <varlistentry>\r
2334 <term>\r
2335 --diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]\r
2336 </term>\r
2337 <listitem>\r
2338 <simpara>\r
2339         Select only files that are Added (<emphasis>A</emphasis>), Copied (<emphasis>C</emphasis>),\r
2340         Deleted (<emphasis>D</emphasis>), Modified (<emphasis>M</emphasis>), Renamed (<emphasis>R</emphasis>), have their\r
2341         type (i.e. regular file, symlink, submodule, &#8230;) changed (<emphasis>T</emphasis>),\r
2342         are Unmerged (<emphasis>U</emphasis>), are\r
2343         Unknown (<emphasis>X</emphasis>), or have had their pairing Broken (<emphasis>B</emphasis>).\r
2344         Any combination of the filter characters (including none) can be used.\r
2345         When <emphasis>*</emphasis> (All-or-none) is added to the combination, all\r
2346         paths are selected if there is any file that matches\r
2347         other criteria in the comparison; if there is no file\r
2348         that matches other criteria, nothing is selected.\r
2349 </simpara>\r
2350 </listitem>\r
2351 </varlistentry>\r
2352 <varlistentry>\r
2353 <term>\r
2354 -S&lt;string&gt;\r
2355 </term>\r
2356 <listitem>\r
2357 <simpara>\r
2358         Look for differences that introduce or remove an instance of\r
2359         &lt;string&gt;. Note that this is different than the string simply\r
2360         appearing in diff output; see the <emphasis>pickaxe</emphasis> entry in\r
2361         <xref linkend="gitdiffcore(7)" /> for more details.\r
2362 </simpara>\r
2363 </listitem>\r
2364 </varlistentry>\r
2365 <varlistentry>\r
2366 <term>\r
2367 -G&lt;regex&gt;\r
2368 </term>\r
2369 <listitem>\r
2370 <simpara>\r
2371         Look for differences whose added or removed line matches\r
2372         the given &lt;regex&gt;.\r
2373 </simpara>\r
2374 </listitem>\r
2375 </varlistentry>\r
2376 <varlistentry>\r
2377 <term>\r
2378 --pickaxe-all\r
2379 </term>\r
2380 <listitem>\r
2381 <simpara>\r
2382         When <emphasis>-S</emphasis> or <emphasis>-G</emphasis> finds a change, show all the changes in that\r
2383         changeset, not just the files that contain the change\r
2384         in &lt;string&gt;.\r
2385 </simpara>\r
2386 </listitem>\r
2387 </varlistentry>\r
2388 <varlistentry>\r
2389 <term>\r
2390 --pickaxe-regex\r
2391 </term>\r
2392 <listitem>\r
2393 <simpara>\r
2394         Make the &lt;string&gt; not a plain string but an extended POSIX\r
2395         regex to match.\r
2396 </simpara>\r
2397 </listitem>\r
2398 </varlistentry>\r
2399 <varlistentry>\r
2400 <term>\r
2401 -O&lt;orderfile&gt;\r
2402 </term>\r
2403 <listitem>\r
2404 <simpara>\r
2405         Output the patch in the order specified in the\r
2406         &lt;orderfile&gt;, which has one shell glob pattern per line.\r
2407 </simpara>\r
2408 </listitem>\r
2409 </varlistentry>\r
2410 <varlistentry>\r
2411 <term>\r
2412 -R\r
2413 </term>\r
2414 <listitem>\r
2415 <simpara>\r
2416         Swap two inputs; that is, show differences from index or\r
2417         on-disk file to tree contents.\r
2418 </simpara>\r
2419 </listitem>\r
2420 </varlistentry>\r
2421 <varlistentry>\r
2422 <term>\r
2423 --relative[=&lt;path&gt;]\r
2424 </term>\r
2425 <listitem>\r
2426 <simpara>\r
2427         When run from a subdirectory of the project, it can be\r
2428         told to exclude changes outside the directory and show\r
2429         pathnames relative to it with this option.  When you are\r
2430         not in a subdirectory (e.g. in a bare repository), you\r
2431         can name which subdirectory to make the output relative\r
2432         to by giving a &lt;path&gt; as an argument.\r
2433 </simpara>\r
2434 </listitem>\r
2435 </varlistentry>\r
2436 <varlistentry>\r
2437 <term>\r
2438 -a\r
2439 </term>\r
2440 <term>\r
2441 --text\r
2442 </term>\r
2443 <listitem>\r
2444 <simpara>\r
2445         Treat all files as text.\r
2446 </simpara>\r
2447 </listitem>\r
2448 </varlistentry>\r
2449 <varlistentry>\r
2450 <term>\r
2451 --ignore-space-at-eol\r
2452 </term>\r
2453 <listitem>\r
2454 <simpara>\r
2455         Ignore changes in whitespace at EOL.\r
2456 </simpara>\r
2457 </listitem>\r
2458 </varlistentry>\r
2459 <varlistentry>\r
2460 <term>\r
2461 -b\r
2462 </term>\r
2463 <term>\r
2464 --ignore-space-change\r
2465 </term>\r
2466 <listitem>\r
2467 <simpara>\r
2468         Ignore changes in amount of whitespace.  This ignores whitespace\r
2469         at line end, and considers all other sequences of one or\r
2470         more whitespace characters to be equivalent.\r
2471 </simpara>\r
2472 </listitem>\r
2473 </varlistentry>\r
2474 <varlistentry>\r
2475 <term>\r
2476 -w\r
2477 </term>\r
2478 <term>\r
2479 --ignore-all-space\r
2480 </term>\r
2481 <listitem>\r
2482 <simpara>\r
2483         Ignore whitespace when comparing lines.  This ignores\r
2484         differences even if one line has whitespace where the other\r
2485         line has none.\r
2486 </simpara>\r
2487 </listitem>\r
2488 </varlistentry>\r
2489 <varlistentry>\r
2490 <term>\r
2491 --inter-hunk-context=&lt;lines&gt;\r
2492 </term>\r
2493 <listitem>\r
2494 <simpara>\r
2495         Show the context between diff hunks, up to the specified number\r
2496         of lines, thereby fusing hunks that are close to each other.\r
2497 </simpara>\r
2498 </listitem>\r
2499 </varlistentry>\r
2500 <varlistentry>\r
2501 <term>\r
2502 -W\r
2503 </term>\r
2504 <term>\r
2505 --function-context\r
2506 </term>\r
2507 <listitem>\r
2508 <simpara>\r
2509         Show whole surrounding functions of changes.\r
2510 </simpara>\r
2511 </listitem>\r
2512 </varlistentry>\r
2513 <varlistentry>\r
2514 <term>\r
2515 --ext-diff\r
2516 </term>\r
2517 <listitem>\r
2518 <simpara>\r
2519         Allow an external diff helper to be executed. If you set an\r
2520         external diff driver with <xref linkend="gitattributes(5)" />, you need\r
2521         to use this option with <xref linkend="git-log(1)" /> and friends.\r
2522 </simpara>\r
2523 </listitem>\r
2524 </varlistentry>\r
2525 <varlistentry>\r
2526 <term>\r
2527 --no-ext-diff\r
2528 </term>\r
2529 <listitem>\r
2530 <simpara>\r
2531         Disallow external diff drivers.\r
2532 </simpara>\r
2533 </listitem>\r
2534 </varlistentry>\r
2535 <varlistentry>\r
2536 <term>\r
2537 --textconv\r
2538 </term>\r
2539 <term>\r
2540 --no-textconv\r
2541 </term>\r
2542 <listitem>\r
2543 <simpara>\r
2544         Allow (or disallow) external text conversion filters to be run\r
2545         when comparing binary files. See <xref linkend="gitattributes(5)" /> for\r
2546         details. Because textconv filters are typically a one-way\r
2547         conversion, the resulting diff is suitable for human\r
2548         consumption, but cannot be applied. For this reason, textconv\r
2549         filters are enabled by default only for <xref linkend="git-diff(1)" /> and\r
2550         <xref linkend="git-log(1)" />, but not for <xref linkend="git-format-patch(1)" /> or\r
2551         diff plumbing commands.\r
2552 </simpara>\r
2553 </listitem>\r
2554 </varlistentry>\r
2555 <varlistentry>\r
2556 <term>\r
2557 --ignore-submodules[=&lt;when&gt;]\r
2558 </term>\r
2559 <listitem>\r
2560 <simpara>\r
2561         Ignore changes to submodules in the diff generation. &lt;when&gt; can be\r
2562         either "none", "untracked", "dirty" or "all", which is the default\r
2563         Using "none" will consider the submodule modified when it either contains\r
2564         untracked or modified files or its HEAD differs from the commit recorded\r
2565         in the superproject and can be used to override any settings of the\r
2566         <emphasis>ignore</emphasis> option in <xref linkend="git-config(1)" /> or <xref linkend="gitmodules(5)" />. When\r
2567         "untracked" is used submodules are not considered dirty when they only\r
2568         contain untracked content (but they are still scanned for modified\r
2569         content). Using "dirty" ignores all changes to the work tree of submodules,\r
2570         only changes to the commits stored in the superproject are shown (this was\r
2571         the behavior until 1.7.0). Using "all" hides all changes to submodules.\r
2572 </simpara>\r
2573 </listitem>\r
2574 </varlistentry>\r
2575 <varlistentry>\r
2576 <term>\r
2577 --src-prefix=&lt;prefix&gt;\r
2578 </term>\r
2579 <listitem>\r
2580 <simpara>\r
2581         Show the given source prefix instead of "a/".\r
2582 </simpara>\r
2583 </listitem>\r
2584 </varlistentry>\r
2585 <varlistentry>\r
2586 <term>\r
2587 --dst-prefix=&lt;prefix&gt;\r
2588 </term>\r
2589 <listitem>\r
2590 <simpara>\r
2591         Show the given destination prefix instead of "b/".\r
2592 </simpara>\r
2593 </listitem>\r
2594 </varlistentry>\r
2595 <varlistentry>\r
2596 <term>\r
2597 --no-prefix\r
2598 </term>\r
2599 <listitem>\r
2600 <simpara>\r
2601         Do not show any source or destination prefix.\r
2602 </simpara>\r
2603 </listitem>\r
2604 </varlistentry>\r
2605 </variablelist>\r
2606 <simpara>For more detailed explanation on these common options, see also\r
2607 <xref linkend="gitdiffcore(7)" />.</simpara>\r
2608 </simplesect>\r
2609 <simplesect id="_generating_patches_with_p">\r
2610 <title>Generating patches with -p</title>\r
2611 <simpara>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run\r
2612 with a <emphasis>-p</emphasis> option, "git diff" without the <emphasis>--raw</emphasis> option, or\r
2613 "git log" with the "-p" option, they\r
2614 do not produce the output described above; instead they produce a\r
2615 patch file.  You can customize the creation of such patches via the\r
2616 GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</simpara>\r
2617 <simpara>What the -p option produces is slightly different from the traditional\r
2618 diff format:</simpara>\r
2619 <orderedlist numeration="arabic">\r
2620 <listitem>\r
2621 <simpara>\r
2622 It is preceded with a "git diff" header that looks like this:\r
2623 </simpara>\r
2624 <literallayout class="monospaced">diff --git a/file1 b/file2</literallayout>\r
2625 <simpara>The <emphasis>a/</emphasis> and <emphasis>b/</emphasis> filenames are the same unless rename/copy is\r
2626 involved.  Especially, even for a creation or a deletion,\r
2627 <emphasis>/dev/null</emphasis> is <emphasis>not</emphasis> used in place of the <emphasis>a/</emphasis> or <emphasis>b/</emphasis> filenames.</simpara>\r
2628 <simpara>When rename/copy is involved, <emphasis>file1</emphasis> and <emphasis>file2</emphasis> show the\r
2629 name of the source file of the rename/copy and the name of\r
2630 the file that rename/copy produces, respectively.</simpara>\r
2631 </listitem>\r
2632 <listitem>\r
2633 <simpara>\r
2634 It is followed by one or more extended header lines:\r
2635 </simpara>\r
2636 <literallayout class="monospaced">old mode &lt;mode&gt;\r
2637 new mode &lt;mode&gt;\r
2638 deleted file mode &lt;mode&gt;\r
2639 new file mode &lt;mode&gt;\r
2640 copy from &lt;path&gt;\r
2641 copy to &lt;path&gt;\r
2642 rename from &lt;path&gt;\r
2643 rename to &lt;path&gt;\r
2644 similarity index &lt;number&gt;\r
2645 dissimilarity index &lt;number&gt;\r
2646 index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</literallayout>\r
2647 <simpara>File modes are printed as 6-digit octal numbers including the file type\r
2648 and file permission bits.</simpara>\r
2649 <simpara>Path names in extended headers do not include the <emphasis>a/</emphasis> and <emphasis>b/</emphasis> prefixes.</simpara>\r
2650 <simpara>The similarity index is the percentage of unchanged lines, and\r
2651 the dissimilarity index is the percentage of changed lines.  It\r
2652 is a rounded down integer, followed by a percent sign.  The\r
2653 similarity index value of 100% is thus reserved for two equal\r
2654 files, while 100% dissimilarity means that no line from the old\r
2655 file made it into the new one.</simpara>\r
2656 <simpara>The index line includes the SHA-1 checksum before and after the change.\r
2657 The &lt;mode&gt; is included if the file mode does not change; otherwise,\r
2658 separate lines indicate the old and the new mode.</simpara>\r
2659 </listitem>\r
2660 <listitem>\r
2661 <simpara>\r
2662 TAB, LF, double quote and backslash characters in pathnames\r
2663     are represented as <emphasis>\t</emphasis>, <emphasis>\n</emphasis>, <emphasis>\"</emphasis> and <emphasis>\\</emphasis>, respectively.\r
2664     If there is need for such substitution then the whole\r
2665     pathname is put in double quotes.\r
2666 </simpara>\r
2667 </listitem>\r
2668 <listitem>\r
2669 <simpara>\r
2670 All the <emphasis>file1</emphasis> files in the output refer to files before the\r
2671     commit, and all the <emphasis>file2</emphasis> files refer to files after the commit.\r
2672     It is incorrect to apply each change to each file sequentially.  For\r
2673     example, this patch will swap a and b:\r
2674 </simpara>\r
2675 <literallayout class="monospaced">diff --git a/a b/b\r
2676 rename from a\r
2677 rename to b\r
2678 diff --git a/b b/a\r
2679 rename from b\r
2680 rename to a</literallayout>\r
2681 </listitem>\r
2682 </orderedlist>\r
2683 </simplesect>\r
2684 <simplesect id="_combined_diff_format">\r
2685 <title>combined diff format</title>\r
2686 <simpara>Any diff-generating command can take the -c` or <emphasis>--cc</emphasis> option to\r
2687 produce a <emphasis>combined diff</emphasis> when showing a merge. This is the default\r
2688 format when showing merges with <xref linkend="git-diff(1)" /> or\r
2689 <xref linkend="git-show(1)" />. Note also that you can give the `-m option to any\r
2690 of these commands to force generation of diffs with individual parents\r
2691 of a merge.</simpara>\r
2692 <simpara>A <emphasis>combined diff</emphasis> format looks like this:</simpara>\r
2693 <screen>diff --combined describe.c\r
2694 index fabadb8,cc95eb0..4866510\r
2695 --- a/describe.c\r
2696 +++ b/describe.c\r
2697 @@@ -98,20 -98,12 +98,20 @@@\r
2698         return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;\r
2699   }\r
2701 - static void describe(char *arg)\r
2702  -static void describe(struct commit *cmit, int last_one)\r
2703 ++static void describe(char *arg, int last_one)\r
2704   {\r
2705  +      unsigned char sha1[20];\r
2706  +      struct commit *cmit;\r
2707         struct commit_list *list;\r
2708         static int initialized = 0;\r
2709         struct commit_name *n;\r
2711  +      if (get_sha1(arg, sha1) &lt; 0)\r
2712  +              usage(describe_usage);\r
2713  +      cmit = lookup_commit_reference(sha1);\r
2714  +      if (!cmit)\r
2715  +              usage(describe_usage);\r
2716  +\r
2717         if (!initialized) {\r
2718                 initialized = 1;\r
2719                 for_each_ref(get_name);</screen>\r
2720 <orderedlist numeration="arabic">\r
2721 <listitem>\r
2722 <simpara>\r
2723 It is preceded with a "git diff" header, that looks like\r
2724      this (when <emphasis>-c</emphasis> option is used):\r
2725 </simpara>\r
2726 <literallayout class="monospaced">diff --combined file</literallayout>\r
2727 <simpara>or like this (when <emphasis>--cc</emphasis> option is used):</simpara>\r
2728 <literallayout class="monospaced">diff --cc file</literallayout>\r
2729 </listitem>\r
2730 <listitem>\r
2731 <simpara>\r
2732 It is followed by one or more extended header lines\r
2733      (this example shows a merge with two parents):\r
2734 </simpara>\r
2735 <literallayout class="monospaced">index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;\r
2736 mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;\r
2737 new file mode &lt;mode&gt;\r
2738 deleted file mode &lt;mode&gt;,&lt;mode&gt;</literallayout>\r
2739 <simpara>The <emphasis>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</emphasis> line appears only if at least one of\r
2740 the &lt;mode&gt; is different from the rest. Extended headers with\r
2741 information about detected contents movement (renames and\r
2742 copying detection) are designed to work with diff of two\r
2743 &lt;tree-ish&gt; and are not used by combined diff format.</simpara>\r
2744 </listitem>\r
2745 <listitem>\r
2746 <simpara>\r
2747 It is followed by two-line from-file/to-file header\r
2748 </simpara>\r
2749 <literallayout class="monospaced">--- a/file\r
2750 +++ b/file</literallayout>\r
2751 <simpara>Similar to two-line header for traditional <emphasis>unified</emphasis> diff\r
2752 format, <emphasis>/dev/null</emphasis> is used to signal created or deleted\r
2753 files.</simpara>\r
2754 </listitem>\r
2755 <listitem>\r
2756 <simpara>\r
2757 Chunk header format is modified to prevent people from\r
2758      accidentally feeding it to <emphasis>patch -p1</emphasis>. Combined diff format\r
2759      was created for review of merge commit changes, and was not\r
2760      meant for apply. The change is similar to the change in the\r
2761      extended <emphasis>index</emphasis> header:\r
2762 </simpara>\r
2763 <literallayout class="monospaced">@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</literallayout>\r
2764 <simpara>There are (number of parents + 1) <emphasis>@</emphasis> characters in the chunk\r
2765 header for combined diff format.</simpara>\r
2766 </listitem>\r
2767 </orderedlist>\r
2768 <simpara>Unlike the traditional <emphasis>unified</emphasis> diff format, which shows two\r
2769 files A and B with a single column that has <emphasis>-</emphasis> (minus --\r
2770 appears in A but removed in B), <emphasis>+</emphasis> (plus -- missing in A but\r
2771 added to B), or <emphasis>" "</emphasis> (space -- unchanged) prefix, this format\r
2772 compares two or more files file1, file2,&#8230; with one file X, and\r
2773 shows how X differs from each of fileN.  One column for each of\r
2774 fileN is prepended to the output line to note how X's line is\r
2775 different from it.</simpara>\r
2776 <simpara>A <emphasis>-</emphasis> character in the column N means that the line appears in\r
2777 fileN but it does not appear in the result.  A <emphasis>+</emphasis> character\r
2778 in the column N means that the line appears in the result,\r
2779 and fileN does not have that line (in other words, the line was\r
2780 added, from the point of view of that parent).</simpara>\r
2781 <simpara>In the above example output, the function signature was changed\r
2782 from both files (hence two <emphasis>-</emphasis> removals from both file1 and\r
2783 file2, plus <emphasis>++</emphasis> to mean one line that was added does not appear\r
2784 in either file1 nor file2).  Also eight other lines are the same\r
2785 from file1 but do not appear in file2 (hence prefixed with <emphasis>+</emphasis>).</simpara>\r
2786 <simpara>When shown by <emphasis>git diff-tree -c</emphasis>, it compares the parents of a\r
2787 merge commit with the merge result (i.e. file1..fileN are the\r
2788 parents).  When shown by <emphasis>git diff-files -c</emphasis>, it compares the\r
2789 two unresolved merge parents with the working tree file\r
2790 (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka\r
2791 "their version").</simpara>\r
2792 </simplesect>\r
2793 <simplesect id="_examples">\r
2794 <title>Examples</title>\r
2795 <variablelist>\r
2796 <varlistentry>\r
2797 <term>\r
2798 <emphasis>git log --no-merges</emphasis>\r
2799 </term>\r
2800 <listitem>\r
2801 <simpara>\r
2802         Show the whole commit history, but skip any merges\r
2803 </simpara>\r
2804 </listitem>\r
2805 </varlistentry>\r
2806 <varlistentry>\r
2807 <term>\r
2808 <emphasis>git log v2.6.12.. include/scsi drivers/scsi</emphasis>\r
2809 </term>\r
2810 <listitem>\r
2811 <simpara>\r
2812         Show all commits since version <emphasis>v2.6.12</emphasis> that changed any file\r
2813         in the include/scsi or drivers/scsi subdirectories\r
2814 </simpara>\r
2815 </listitem>\r
2816 </varlistentry>\r
2817 <varlistentry>\r
2818 <term>\r
2819 <emphasis>git log --since="2 weeks ago" -- gitk</emphasis>\r
2820 </term>\r
2821 <listitem>\r
2822 <simpara>\r
2823         Show the changes during the last two weeks to the file <emphasis>gitk</emphasis>.\r
2824         The "--" is necessary to avoid confusion with the <emphasis role="strong">branch</emphasis> named\r
2825         <emphasis>gitk</emphasis>\r
2826 </simpara>\r
2827 </listitem>\r
2828 </varlistentry>\r
2829 <varlistentry>\r
2830 <term>\r
2831 <emphasis>git log --name-status release..test</emphasis>\r
2832 </term>\r
2833 <listitem>\r
2834 <simpara>\r
2835         Show the commits that are in the "test" branch but not yet\r
2836         in the "release" branch, along with the list of paths\r
2837         each commit modifies.\r
2838 </simpara>\r
2839 </listitem>\r
2840 </varlistentry>\r
2841 <varlistentry>\r
2842 <term>\r
2843 <emphasis>git log --follow builtin-rev-list.c</emphasis>\r
2844 </term>\r
2845 <listitem>\r
2846 <simpara>\r
2847         Shows the commits that changed builtin-rev-list.c, including\r
2848         those commits that occurred before the file was given its\r
2849         present name.\r
2850 </simpara>\r
2851 </listitem>\r
2852 </varlistentry>\r
2853 <varlistentry>\r
2854 <term>\r
2855 <emphasis>git log --branches --not --remotes=origin</emphasis>\r
2856 </term>\r
2857 <listitem>\r
2858 <simpara>\r
2859         Shows all commits that are in any of local branches but not in\r
2860         any of remote-tracking branches for <emphasis>origin</emphasis> (what you have that\r
2861         origin doesn't).\r
2862 </simpara>\r
2863 </listitem>\r
2864 </varlistentry>\r
2865 <varlistentry>\r
2866 <term>\r
2867 <emphasis>git log master --not --remotes=*/master</emphasis>\r
2868 </term>\r
2869 <listitem>\r
2870 <simpara>\r
2871         Shows all commits that are in local master but not in any remote\r
2872         repository master branches.\r
2873 </simpara>\r
2874 </listitem>\r
2875 </varlistentry>\r
2876 <varlistentry>\r
2877 <term>\r
2878 <emphasis>git log -p -m --first-parent</emphasis>\r
2879 </term>\r
2880 <listitem>\r
2881 <simpara>\r
2882         Shows the history including change diffs, but only from the\r
2883         "main branch" perspective, skipping commits that come from merged\r
2884         branches, and showing full diffs of changes introduced by the merges.\r
2885         This makes sense only when following a strict policy of merging all\r
2886         topic branches when staying on a single integration branch.\r
2887 </simpara>\r
2888 </listitem>\r
2889 </varlistentry>\r
2890 </variablelist>\r
2891 </simplesect>\r
2892 <simplesect id="_discussion">\r
2893 <title>Discussion</title>\r
2894 <simpara>At the core level, git is character encoding agnostic.</simpara>\r
2895 <itemizedlist>\r
2896 <listitem>\r
2897 <simpara>\r
2898 The pathnames recorded in the index and in the tree objects\r
2899    are treated as uninterpreted sequences of non-NUL bytes.\r
2900    What readdir(2) returns are what are recorded and compared\r
2901    with the data git keeps track of, which in turn are expected\r
2902    to be what lstat(2) and creat(2) accepts.  There is no such\r
2903    thing as pathname encoding translation.\r
2904 </simpara>\r
2905 </listitem>\r
2906 <listitem>\r
2907 <simpara>\r
2908 The contents of the blob objects are uninterpreted sequences\r
2909    of bytes.  There is no encoding translation at the core\r
2910    level.\r
2911 </simpara>\r
2912 </listitem>\r
2913 <listitem>\r
2914 <simpara>\r
2915 The commit log messages are uninterpreted sequences of non-NUL\r
2916    bytes.\r
2917 </simpara>\r
2918 </listitem>\r
2919 </itemizedlist>\r
2920 <simpara>Although we encourage that the commit log messages are encoded\r
2921 in UTF-8, both the core and git Porcelain are designed not to\r
2922 force UTF-8 on projects.  If all participants of a particular\r
2923 project find it more convenient to use legacy encodings, git\r
2924 does not forbid it.  However, there are a few things to keep in\r
2925 mind.</simpara>\r
2926 <orderedlist numeration="arabic">\r
2927 <listitem>\r
2928 <simpara>\r
2929 <emphasis>git commit</emphasis> and <emphasis>git commit-tree</emphasis> issues\r
2930   a warning if the commit log message given to it does not look\r
2931   like a valid UTF-8 string, unless you explicitly say your\r
2932   project uses a legacy encoding.  The way to say this is to\r
2933   have i18n.commitencoding in <emphasis>.git/config</emphasis> file, like this:\r
2934 </simpara>\r
2935 <screen>[i18n]\r
2936         commitencoding = ISO-8859-1</screen>\r
2937 <simpara>Commit objects created with the above setting record the value\r
2938 of <emphasis>i18n.commitencoding</emphasis> in its <emphasis>encoding</emphasis> header.  This is to\r
2939 help other people who look at them later.  Lack of this header\r
2940 implies that the commit log message is encoded in UTF-8.</simpara>\r
2941 </listitem>\r
2942 <listitem>\r
2943 <simpara>\r
2944 <emphasis>git log</emphasis>, <emphasis>git show</emphasis>, <emphasis>git blame</emphasis> and friends look at the\r
2945   <emphasis>encoding</emphasis> header of a commit object, and try to re-code the\r
2946   log message into UTF-8 unless otherwise specified.  You can\r
2947   specify the desired output encoding with\r
2948   <emphasis>i18n.logoutputencoding</emphasis> in <emphasis>.git/config</emphasis> file, like this:\r
2949 </simpara>\r
2950 <screen>[i18n]\r
2951         logoutputencoding = ISO-8859-1</screen>\r
2952 <simpara>If you do not have this configuration variable, the value of\r
2953 <emphasis>i18n.commitencoding</emphasis> is used instead.</simpara>\r
2954 </listitem>\r
2955 </orderedlist>\r
2956 <simpara>Note that we deliberately chose not to re-code the commit log\r
2957 message when a commit is made to force UTF-8 at the commit\r
2958 object level, because re-coding to UTF-8 is not necessarily a\r
2959 reversible operation.</simpara>\r
2960 </simplesect>\r
2961 <simplesect id="_configuration">\r
2962 <title>Configuration</title>\r
2963 <simpara>See <xref linkend="git-config(1)" /> for core variables and <xref linkend="git-diff(1)" />\r
2964 for settings related to diff generation.</simpara>\r
2965 <variablelist>\r
2966 <varlistentry>\r
2967 <term>\r
2968 format.pretty\r
2969 </term>\r
2970 <listitem>\r
2971 <simpara>\r
2972         Default for the <emphasis>--format</emphasis> option.  (See "PRETTY FORMATS" above.)\r
2973         Defaults to "medium".\r
2974 </simpara>\r
2975 </listitem>\r
2976 </varlistentry>\r
2977 <varlistentry>\r
2978 <term>\r
2979 i18n.logOutputEncoding\r
2980 </term>\r
2981 <listitem>\r
2982 <simpara>\r
2983         Encoding to use when displaying logs.  (See "Discussion", above.)\r
2984         Defaults to the value of <emphasis>i18n.commitEncoding</emphasis> if set, UTF-8\r
2985         otherwise.\r
2986 </simpara>\r
2987 </listitem>\r
2988 </varlistentry>\r
2989 <varlistentry>\r
2990 <term>\r
2991 log.date\r
2992 </term>\r
2993 <listitem>\r
2994 <simpara>\r
2995         Default format for human-readable dates.  (Compare the\r
2996         <emphasis>--date</emphasis> option.)  Defaults to "default", which means to write\r
2997         dates like <emphasis>Sat May 8 19:35:34 2010 -0500</emphasis>.\r
2998 </simpara>\r
2999 </listitem>\r
3000 </varlistentry>\r
3001 <varlistentry>\r
3002 <term>\r
3003 log.showroot\r
3004 </term>\r
3005 <listitem>\r
3006 <simpara>\r
3007         If <emphasis>false</emphasis>, <emphasis>git log</emphasis> and related commands will not treat the\r
3008         initial commit as a big creation event.  Any root commits in\r
3009         <emphasis>git log -p</emphasis> output would be shown without a diff attached.\r
3010         The default is <emphasis>true</emphasis>.\r
3011 </simpara>\r
3012 </listitem>\r
3013 </varlistentry>\r
3014 <varlistentry>\r
3015 <term>\r
3016 mailmap.file\r
3017 </term>\r
3018 <listitem>\r
3019 <simpara>\r
3020         See <xref linkend="git-shortlog(1)" />.\r
3021 </simpara>\r
3022 </listitem>\r
3023 </varlistentry>\r
3024 <varlistentry>\r
3025 <term>\r
3026 notes.displayRef\r
3027 </term>\r
3028 <listitem>\r
3029 <simpara>\r
3030         Which refs, in addition to the default set by <emphasis>core.notesRef</emphasis>\r
3031         or <emphasis>GIT_NOTES_REF</emphasis>, to read notes from when showing commit\r
3032         messages with the <emphasis>log</emphasis> family of commands.  See\r
3033         <xref linkend="git-notes(1)" />.\r
3034 </simpara>\r
3035 <simpara>May be an unabbreviated ref name or a glob and may be specified\r
3036 multiple times.  A warning will be issued for refs that do not exist,\r
3037 but a glob that does not match any refs is silently ignored.</simpara>\r
3038 <simpara>This setting can be disabled by the <emphasis>--no-notes</emphasis> option,\r
3039 overridden by the <emphasis>GIT_NOTES_DISPLAY_REF</emphasis> environment variable,\r
3040 and overridden by the <emphasis>--notes=&lt;ref&gt;</emphasis> option.</simpara>\r
3041 </listitem>\r
3042 </varlistentry>\r
3043 </variablelist>\r
3044 </simplesect>\r
3045 <simplesect id="_git">\r
3046 <title>GIT</title>\r
3047 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>\r
3048 </simplesect>\r
3049 </article>\r