blob: 969592bb6a1f1094aceec2924ff35a0c04020e85 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Junio C Hamanoba4b9282008-07-06 05:20:316<meta name="generator" content="AsciiDoc 8.2.5" />
Junio C Hamano1a4e8412005-12-27 08:17:237<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
Junio C Hamanoba4b9282008-07-06 05:20:3119a {
20 color: blue;
21 text-decoration: underline;
22}
23a:visited {
24 color: fuchsia;
25}
Junio C Hamano1a4e8412005-12-27 08:17:2326
27em {
28 font-style: italic;
29}
30
31strong {
32 font-weight: bold;
33}
34
35tt {
36 color: navy;
37}
38
39h1, h2, h3, h4, h5, h6 {
40 color: #527bbd;
41 font-family: sans-serif;
42 margin-top: 1.2em;
43 margin-bottom: 0.5em;
44 line-height: 1.3;
45}
46
Junio C Hamanoba4b9282008-07-06 05:20:3147h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2348 border-bottom: 2px solid silver;
49}
50h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2351 padding-top: 0.5em;
52}
Junio C Hamanoba4b9282008-07-06 05:20:3153h3 {
54 float: left;
55}
56h3 + * {
57 clear: left;
58}
Junio C Hamano1a4e8412005-12-27 08:17:2359
60div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
63}
64
65hr {
66 border: 1px solid silver;
67}
68
69p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
72}
73
74pre {
75 padding: 0;
76 margin: 0;
77}
78
79span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3183 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:2384}
85span#email {
86}
87span#revision {
88 font-family: sans-serif;
89}
90
91div#footer {
92 font-family: sans-serif;
93 font-size: small;
94 border-top: 2px solid silver;
95 padding-top: 0.5em;
96 margin-top: 4.0em;
97}
98div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
101}
102div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
105}
106
107div#preamble,
108div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
114}
115div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
118}
119
120div.content { /* Block element content. */
121 padding: 0;
122}
123
124/* Block element titles. */
125div.title, caption.title {
126 font-family: sans-serif;
127 font-weight: bold;
128 text-align: left;
129 margin-top: 1.0em;
130 margin-bottom: 0.5em;
131}
132div.title + * {
133 margin-top: 0;
134}
135
136td div.title:first-child {
137 margin-top: 0.0em;
138}
139div.content div.title:first-child {
140 margin-top: 0.0em;
141}
142div.content + div.title {
143 margin-top: 0.0em;
144}
145
146div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
150}
151
Junio C Hamanoba4b9282008-07-06 05:20:31152div.listingblock {
153 margin-right: 0%;
154}
Junio C Hamano1a4e8412005-12-27 08:17:23155div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
159}
160
161div.quoteblock > div.content {
162 padding-left: 2.0em;
163}
Junio C Hamanoba4b9282008-07-06 05:20:31164
165div.attribution {
Junio C Hamano1a4e8412005-12-27 08:17:23166 text-align: right;
167}
Junio C Hamanoba4b9282008-07-06 05:20:31168div.verseblock + div.attribution {
169 text-align: left;
170}
Junio C Hamano1a4e8412005-12-27 08:17:23171
172div.admonitionblock .icon {
173 vertical-align: top;
174 font-size: 1.1em;
175 font-weight: bold;
176 text-decoration: underline;
177 color: #527bbd;
178 padding-right: 0.5em;
179}
180div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
183}
184
185div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
188}
189
190div.verseblock div.content {
191 white-space: pre;
192}
193
194div.imageblock div.content { padding-left: 0; }
195div.imageblock img { border: 1px solid silver; }
196span.image img { border-style: none; }
197
198dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
201}
202dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
206}
207dd > *:first-child {
208 margin-top: 0;
209}
210
211ul, ol {
212 list-style-position: outside;
213}
Junio C Hamanoba4b9282008-07-06 05:20:31214div.olist2 ol {
Junio C Hamano1a4e8412005-12-27 08:17:23215 list-style-type: lower-alpha;
216}
217
218div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31219 border: 3px solid #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23220}
221thead {
222 font-family: sans-serif;
223 font-weight: bold;
224}
225tfoot {
226 font-weight: bold;
227}
228
229div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
Junio C Hamanoba4b9282008-07-06 05:20:31233div.hlist td {
234 padding-bottom: 5px;
235}
Junio C Hamano1a4e8412005-12-27 08:17:23236td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
240}
241td.hlist2 {
242 vertical-align: top;
243}
244
245@media print {
246 div#footer-badges { display: none; }
247}
Junio C Hamanoba4b9282008-07-06 05:20:31248
249div#toctitle {
250 color: #527bbd;
251 font-family: sans-serif;
252 font-size: 1.1em;
253 font-weight: bold;
254 margin-top: 1.0em;
255 margin-bottom: 0.1em;
256}
257
258div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
261}
262div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
265}
266div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
269}
270div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
273}
274include1::./stylesheets/xhtml11-manpage.css[]
Junio C Hamano1a4e8412005-12-27 08:17:23275/* Workarounds for IE6's broken and incomplete CSS2. */
276
277div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
281}
282div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
287}
288
289div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
293}
294
295div.quoteblock-content {
296 padding-left: 2.0em;
297}
298
299div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
302}
Junio C Hamanoba4b9282008-07-06 05:20:31303
304/* IE6 sets dynamically generated links as visited. */
305div#toc a:visited { color: blue; }
Junio C Hamano1a4e8412005-12-27 08:17:23306</style>
307<title>git-diff-tree(1)</title>
308</head>
309<body>
310<div id="header">
311<h1>
312git-diff-tree(1) Manual Page
313</h1>
314<h2>NAME</h2>
315<div class="sectionbody">
316<p>git-diff-tree -
317 Compares the content and mode of blobs found via two tree objects
318</p>
319</div>
320</div>
321<h2>SYNOPSIS</h2>
322<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58323<div class="verseblock">
Junio C Hamanofce7c7e2008-07-02 03:06:38324<div class="content"><em>git diff-tree</em> [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]
Junio C Hamanofb56a962006-01-28 10:38:19325 [-t] [-r] [-c | --cc] [--root] [&lt;common diff options&gt;]
326 &lt;tree-ish&gt; [&lt;tree-ish&gt;] [&lt;path&gt;&#8230;]</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23327</div>
Junio C Hamanoba4b9282008-07-06 05:20:31328<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23329<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31330<div class="para"><p>Compares the content and mode of the blobs found via two tree objects.</p></div>
331<div class="para"><p>If there is only one &lt;tree-ish&gt; given, the commit is compared with its parents
332(see --stdin below).</p></div>
333<div class="para"><p>Note that <em>git-diff-tree</em> can use the tree encapsulated in a commit object.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23334</div>
Junio C Hamanoba4b9282008-07-06 05:20:31335<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23336<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31337<div class="vlist"><dl>
Junio C Hamano1a4e8412005-12-27 08:17:23338<dt>
339-p
340</dt>
341<dd>
342<p>
Junio C Hamanoff979792007-11-16 10:11:30343 Generate patch (see section on generating patches).
344
Junio C Hamano1a4e8412005-12-27 08:17:23345</p>
346</dd>
347<dt>
348-u
349</dt>
350<dd>
351<p>
352 Synonym for "-p".
353</p>
354</dd>
355<dt>
Junio C Hamano69361562007-07-26 02:14:34356-U&lt;n&gt;
357</dt>
358<dd>
359<p>
360 Shorthand for "--unified=&lt;n&gt;".
361</p>
362</dd>
363<dt>
364--unified=&lt;n&gt;
365</dt>
366<dd>
367<p>
368 Generate diffs with &lt;n&gt; lines of context instead of
369 the usual three. Implies "-p".
370</p>
371</dd>
372<dt>
Junio C Hamano9ae1a062006-07-10 08:12:34373--raw
374</dt>
375<dd>
376<p>
377 Generate the raw format.
Junio C Hamanoff979792007-11-16 10:11:30378 This is the default.
Junio C Hamano9ae1a062006-07-10 08:12:34379</p>
380</dd>
381<dt>
Junio C Hamano54559c82006-04-13 07:45:12382--patch-with-raw
383</dt>
384<dd>
385<p>
Junio C Hamano9ae1a062006-07-10 08:12:34386 Synonym for "-p --raw".
Junio C Hamano54559c82006-04-13 07:45:12387</p>
388</dd>
389<dt>
Junio C Hamano4a9a76a2006-10-01 05:40:29390--stat[=width[,name-width]]
Junio C Hamanoba7c8d82006-04-15 06:17:42391</dt>
392<dd>
393<p>
Junio C Hamano4a9a76a2006-10-01 05:40:29394 Generate a diffstat. You can override the default
395 output width for 80-column terminal by "--stat=width".
396 The width of the filename part can be controlled by
397 giving another width to it separated by a comma.
Junio C Hamanoba7c8d82006-04-15 06:17:42398</p>
399</dd>
400<dt>
Junio C Hamanofbe00522006-10-19 05:58:48401--numstat
402</dt>
403<dd>
404<p>
405 Similar to --stat, but shows number of added and
406 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43407 abbreviation, to make it more machine friendly. For
408 binary files, outputs two <tt>-</tt> instead of saying
409 <tt>0 0</tt>.
Junio C Hamanofbe00522006-10-19 05:58:48410</p>
411</dd>
412<dt>
Junio C Hamano7d23f5e2006-12-16 07:44:04413--shortstat
414</dt>
415<dd>
416<p>
417 Output only the last line of the --stat format containing total
418 number of modified files, as well as number of added and deleted
419 lines.
420</p>
421</dd>
422<dt>
Junio C Hamano6a45be92008-04-22 08:19:03423--dirstat[=limit]
424</dt>
425<dd>
426<p>
Junio C Hamanoa2f46622008-09-03 05:20:31427 Output the distribution of relative amount of changes (number of lines added or
428 removed) for each sub-directory. Directories with changes below
429 a cut-off percent (3% by default) are not shown. The cut-off percent
430 can be set with "--dirstat=limit". Changes in a child directory is not
431 counted for the parent directory, unless "--cumulative" is used.
Junio C Hamano6a45be92008-04-22 08:19:03432</p>
433</dd>
434<dt>
Junio C Hamanoa476efa2008-10-10 15:31:42435--dirstat-by-file[=limit]
436</dt>
437<dd>
438<p>
439 Same as --dirstat, but counts changed files instead of lines.
440</p>
441</dd>
442<dt>
Junio C Hamano6959c6c2006-05-17 10:34:11443--summary
444</dt>
445<dd>
446<p>
447 Output a condensed summary of extended header information
448 such as creations, renames and mode changes.
449</p>
450</dd>
451<dt>
Junio C Hamanod1308c92006-04-16 11:01:09452--patch-with-stat
453</dt>
454<dd>
455<p>
Junio C Hamano9ae1a062006-07-10 08:12:34456 Synonym for "-p --stat".
Junio C Hamanoff979792007-11-16 10:11:30457
Junio C Hamanod1308c92006-04-16 11:01:09458</p>
459</dd>
460<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23461-z
462</dt>
463<dd>
464<p>
Junio C Hamanob968dbb2007-07-27 07:26:40465 NUL-line termination on output. This affects the --raw
466 output field terminator. Also output from commands such
467 as "git-log" will be delimited with NUL between commits.
Junio C Hamano1a4e8412005-12-27 08:17:23468</p>
469</dd>
470<dt>
471--name-only
472</dt>
473<dd>
474<p>
475 Show only names of changed files.
476</p>
477</dd>
478<dt>
479--name-status
480</dt>
481<dd>
482<p>
Junio C Hamanoa9aee782008-04-23 16:09:20483 Show only names and status of changed files. See the description
484 of the <tt>--diff-filter</tt> option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:23485</p>
486</dd>
487<dt>
Junio C Hamano9ae1a062006-07-10 08:12:34488--color
489</dt>
490<dd>
491<p>
492 Show colored diff.
493</p>
494</dd>
495<dt>
496--no-color
497</dt>
498<dd>
499<p>
500 Turn off colored diff, even when the configuration file
501 gives the default to color output.
502</p>
503</dd>
504<dt>
Junio C Hamano85e45fa2006-08-13 07:47:41505--color-words
506</dt>
507<dd>
508<p>
509 Show colored word diff, i.e. color words which have changed.
510</p>
511</dd>
512<dt>
Junio C Hamano9ae1a062006-07-10 08:12:34513--no-renames
514</dt>
515<dd>
516<p>
517 Turn off rename detection, even when the configuration
518 file gives the default to do so.
519</p>
520</dd>
521<dt>
Junio C Hamanoa890c4f2007-01-28 10:29:21522--check
523</dt>
524<dd>
525<p>
526 Warn if changes introduce trailing whitespace
Junio C Hamano3dac5042007-12-15 08:40:54527 or an indent that uses a space before a tab. Exits with
528 non-zero status if problems are found. Not compatible with
529 --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:21530</p>
531</dd>
532<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23533--full-index
534</dt>
535<dd>
536<p>
Junio C Hamano5cf43ca2008-08-20 09:14:14537 Instead of the first handful of characters, show the full
538 pre- and post-image blob object names on the "index"
539 line when generating patch format output.
Junio C Hamano1a4e8412005-12-27 08:17:23540</p>
541</dd>
542<dt>
Junio C Hamano9ae1a062006-07-10 08:12:34543--binary
544</dt>
545<dd>
546<p>
547 In addition to --full-index, output "binary diff" that
548 can be applied with "git apply".
549</p>
550</dd>
551<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23552--abbrev[=&lt;n&gt;]
553</dt>
554<dd>
555<p>
556 Instead of showing the full 40-byte hexadecimal object
557 name in diff-raw format output and diff-tree header
Junio C Hamano235a91e2006-01-07 01:13:58558 lines, show only handful hexdigits prefix. This is
Junio C Hamano1a4e8412005-12-27 08:17:23559 independent of --full-index option above, which controls
560 the diff-patch output format. Non default number of
561 digits can be specified with --abbrev=&lt;n&gt;.
562</p>
563</dd>
564<dt>
565-B
566</dt>
567<dd>
568<p>
569 Break complete rewrite changes into pairs of delete and create.
570</p>
571</dd>
572<dt>
573-M
574</dt>
575<dd>
576<p>
577 Detect renames.
578</p>
579</dd>
580<dt>
581-C
582</dt>
583<dd>
584<p>
Junio C Hamano16f98872007-06-12 16:09:14585 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
Junio C Hamano1a4e8412005-12-27 08:17:23586</p>
587</dd>
588<dt>
Junio C Hamano6ec31b92006-02-10 05:52:01589--diff-filter=[ACDMRTUXB*]
590</dt>
591<dd>
592<p>
593 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
594 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
Junio C Hamanoa2deec52008-10-18 18:58:09595 type (i.e. regular file, symlink, submodule, &#8230;) changed (<tt>T</tt>),
596 are Unmerged (<tt>U</tt>), are
Junio C Hamano6ec31b92006-02-10 05:52:01597 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
598 Any combination of the filter characters may be used.
599 When <tt>*</tt> (All-or-none) is added to the combination, all
600 paths are selected if there is any file that matches
601 other criteria in the comparison; if there is no file
602 that matches other criteria, nothing is selected.
603</p>
604</dd>
605<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23606--find-copies-harder
607</dt>
608<dd>
609<p>
Junio C Hamano16f98872007-06-12 16:09:14610 For performance reasons, by default, <tt>-C</tt> option finds copies only
Junio C Hamano1a4e8412005-12-27 08:17:23611 if the original file of the copy was modified in the same
612 changeset. This flag makes the command
613 inspect unmodified files as candidates for the source of
614 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:14615 projects, so use it with caution. Giving more than one
616 <tt>-C</tt> option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:23617</p>
618</dd>
619<dt>
620-l&lt;num&gt;
621</dt>
622<dd>
623<p>
624 -M and -C options require O(n^2) processing time where n
625 is the number of potential rename/copy targets. This
626 option prevents rename/copy detection from running if
627 the number of rename/copy targets exceeds the specified
628 number.
629</p>
630</dd>
631<dt>
632-S&lt;string&gt;
633</dt>
634<dd>
635<p>
636 Look for differences that contain the change in &lt;string&gt;.
637</p>
638</dd>
639<dt>
640--pickaxe-all
641</dt>
642<dd>
643<p>
644 When -S finds a change, show all the changes in that
645 changeset, not just the files that contain the change
646 in &lt;string&gt;.
647</p>
648</dd>
649<dt>
Junio C Hamanobfe9e752006-04-05 21:43:28650--pickaxe-regex
651</dt>
652<dd>
653<p>
654 Make the &lt;string&gt; not a plain string but an extended POSIX
655 regex to match.
656</p>
657</dd>
658<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23659-O&lt;orderfile&gt;
660</dt>
661<dd>
662<p>
663 Output the patch in the order specified in the
664 &lt;orderfile&gt;, which has one shell glob pattern per line.
665</p>
666</dd>
667<dt>
668-R
669</dt>
670<dd>
671<p>
672 Swap two inputs; that is, show differences from index or
673 on-disk file to tree contents.
674</p>
675</dd>
Junio C Hamanoc26f5482006-07-09 09:38:14676<dt>
Junio C Hamano24bc09a2008-02-28 00:27:44677--relative[=&lt;path&gt;]
678</dt>
679<dd>
680<p>
681 When run from a subdirectory of the project, it can be
682 told to exclude changes outside the directory and show
683 pathnames relative to it with this option. When you are
684 not in a subdirectory (e.g. in a bare repository), you
685 can name which subdirectory to make the output relative
686 to by giving a &lt;path&gt; as an argument.
687</p>
688</dd>
689<dt>
Junio C Hamanoc26f5482006-07-09 09:38:14690--text
691</dt>
692<dd>
693<p>
694 Treat all files as text.
695</p>
696</dd>
697<dt>
698-a
699</dt>
700<dd>
701<p>
702 Shorthand for "--text".
703</p>
704</dd>
Junio C Hamanod9c2d2f2006-12-06 08:59:07705<dt>
Junio C Hamanofd468962007-02-14 23:45:04706--ignore-space-at-eol
707</dt>
708<dd>
709<p>
Junio C Hamano3a702342007-12-12 21:34:02710 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:04711</p>
712</dd>
713<dt>
Junio C Hamanod9c2d2f2006-12-06 08:59:07714--ignore-space-change
715</dt>
716<dd>
717<p>
Junio C Hamano3a702342007-12-12 21:34:02718 Ignore changes in amount of whitespace. This ignores whitespace
719 at line end, and considers all other sequences of one or
720 more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:07721</p>
722</dd>
723<dt>
724-b
725</dt>
726<dd>
727<p>
728 Shorthand for "--ignore-space-change".
729</p>
730</dd>
731<dt>
732--ignore-all-space
733</dt>
734<dd>
735<p>
Junio C Hamano3a702342007-12-12 21:34:02736 Ignore whitespace when comparing lines. This ignores
737 differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:07738 line has none.
739</p>
740</dd>
741<dt>
742-w
743</dt>
744<dd>
745<p>
746 Shorthand for "--ignore-all-space".
747</p>
748</dd>
Junio C Hamano48fd2f62007-03-19 02:02:30749<dt>
750--exit-code
751</dt>
752<dd>
753<p>
754 Make the program exit with codes similar to diff(1).
755 That is, it exits with 1 if there were differences and
756 0 means no differences.
757</p>
758</dd>
Junio C Hamano35e57552007-03-25 07:54:35759<dt>
760--quiet
761</dt>
762<dd>
763<p>
764 Disable all output of the program. Implies --exit-code.
765</p>
766</dd>
Junio C Hamanobb0f4042007-07-04 06:41:40767<dt>
768--ext-diff
769</dt>
770<dd>
771<p>
772 Allow an external diff helper to be executed. If you set an
Junio C Hamano1b50ce92007-10-03 12:05:53773 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
774 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:40775</p>
776</dd>
777<dt>
778--no-ext-diff
779</dt>
780<dd>
781<p>
782 Disallow external diff drivers.
783</p>
784</dd>
Junio C Hamanoe27cbd22007-12-21 17:57:33785<dt>
Junio C Hamanodfccbb02008-05-26 01:16:14786--ignore-submodules
787</dt>
788<dd>
789<p>
790 Ignore changes to submodules in the diff generation.
791</p>
792</dd>
793<dt>
Junio C Hamanoe27cbd22007-12-21 17:57:33794--src-prefix=&lt;prefix&gt;
795</dt>
796<dd>
797<p>
798 Show the given source prefix instead of "a/".
799</p>
800</dd>
801<dt>
802--dst-prefix=&lt;prefix&gt;
803</dt>
804<dd>
805<p>
806 Show the given destination prefix instead of "b/".
807</p>
808</dd>
809<dt>
810--no-prefix
811</dt>
812<dd>
813<p>
814 Do not show any source or destination prefix.
815</p>
816</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31817</dl></div>
818<div class="para"><p>For more detailed explanation on these common options, see also
819<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
820<div class="vlist"><dl>
Junio C Hamano1a4e8412005-12-27 08:17:23821<dt>
822&lt;tree-ish&gt;
823</dt>
824<dd>
825<p>
826 The id of a tree object.
827</p>
828</dd>
829<dt>
830&lt;path&gt;&#8230;
831</dt>
832<dd>
833<p>
834 If provided, the results are limited to a subset of files
835 matching one of these prefix strings.
Junio C Hamano341071d2006-06-04 07:24:48836 i.e., file matches <tt>/^&lt;pattern1&gt;|&lt;pattern2&gt;|&#8230;/</tt>
Junio C Hamano1a4e8412005-12-27 08:17:23837 Note that this parameter does not provide any wildcard or regexp
838 features.
839</p>
840</dd>
841<dt>
842-r
843</dt>
844<dd>
845<p>
846 recurse into sub-trees
847</p>
848</dd>
849<dt>
850-t
851</dt>
852<dd>
853<p>
854 show tree entry itself as well as subtrees. Implies -r.
855</p>
856</dd>
857<dt>
858--root
859</dt>
860<dd>
861<p>
862 When <em>--root</em> is specified the initial commit will be showed as a big
863 creation event. This is equivalent to a diff against the NULL tree.
864</p>
865</dd>
866<dt>
867--stdin
868</dt>
869<dd>
870<p>
871 When <em>--stdin</em> is specified, the command does not take
872 &lt;tree-ish&gt; arguments from the command line. Instead, it
Junio C Hamano3f2f6e52008-08-21 10:34:22873 reads lines containing either two &lt;tree&gt;, one &lt;commit&gt;, or a
874 list of &lt;commit&gt; from its standard input. (Use a single space
875 as separator.)
Junio C Hamano1a4e8412005-12-27 08:17:23876</p>
Junio C Hamano3f2f6e52008-08-21 10:34:22877<div class="para"><p>When two trees are given, it compares the first tree with the second.
878When a single commit is given, it compares the commit with its
879parents. The remaining commits, when given, are used as if they are
Junio C Hamanob53db3c2008-08-07 00:17:52880parents of the first commit.</p></div>
Junio C Hamano3f2f6e52008-08-21 10:34:22881<div class="para"><p>When comparing two trees, the ID of both trees (separated by a space
882and terminated by a newline) is printed before the difference. When
883comparing commits, the ID of the first (or only) commit, followed by a
884newline, is printed.</p></div>
885<div class="para"><p>The following flags further affects the behavior when comparing
886commits (but not trees).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23887</dd>
888<dt>
889-m
890</dt>
891<dd>
892<p>
Junio C Hamanoba4b9282008-07-06 05:20:31893 By default, <em>git-diff-tree --stdin</em> does not show
Junio C Hamano1a4e8412005-12-27 08:17:23894 differences for merge commits. With this flag, it shows
Junio C Hamanoa8adb1e2006-04-10 23:46:16895 differences to that commit from all of its parents. See
896 also <em>-c</em>.
Junio C Hamano1a4e8412005-12-27 08:17:23897</p>
898</dd>
899<dt>
900-s
901</dt>
902<dd>
903<p>
Junio C Hamanoba4b9282008-07-06 05:20:31904 By default, <em>git-diff-tree --stdin</em> shows differences,
Junio C Hamano1a4e8412005-12-27 08:17:23905 either in machine-readable form (without <em>-p</em>) or in patch
Junio C Hamano235a91e2006-01-07 01:13:58906 form (with <em>-p</em>). This output can be suppressed. It is
Junio C Hamano1a4e8412005-12-27 08:17:23907 only useful with <em>-v</em> flag.
908</p>
909</dd>
910<dt>
911-v
912</dt>
913<dd>
914<p>
Junio C Hamanoba4b9282008-07-06 05:20:31915 This flag causes <em>git-diff-tree --stdin</em> to also show
Junio C Hamano1a4e8412005-12-27 08:17:23916 the commit message before the differences.
917</p>
918</dd>
919<dt>
Junio C Hamanoa340aaa2006-11-23 02:47:33920--pretty[=<em>&lt;format&gt;</em>]
Junio C Hamano1a4e8412005-12-27 08:17:23921</dt>
922<dd>
923<p>
Junio C Hamanoa3770f92007-07-25 08:53:33924 Pretty-print the contents of the commit logs in a given format,
Junio C Hamano0430e3a2007-05-15 03:13:17925 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
926 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>.
Junio C Hamanoa3770f92007-07-25 08:53:33927 When omitted, the format defaults to <em>medium</em>.
Junio C Hamano1a4e8412005-12-27 08:17:23928</p>
Junio C Hamanoba4b9282008-07-06 05:20:31929<div class="para"><p>Note: you can specify the default pretty format in the repository
930configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:17931</dd>
932<dt>
Junio C Hamanoee695f22007-06-21 00:35:36933--abbrev-commit
934</dt>
935<dd>
936<p>
937 Instead of showing the full 40-byte hexadecimal commit object
938 name, show only handful hexdigits prefix. Non default number of
939 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
940 diff output, if it is displayed).
941</p>
Junio C Hamanoba4b9282008-07-06 05:20:31942<div class="para"><p>This should make "--pretty=oneline" a whole lot more readable for
943people using 80-column terminals.</p></div>
Junio C Hamanoee695f22007-06-21 00:35:36944</dd>
945<dt>
Junio C Hamano0430e3a2007-05-15 03:13:17946--encoding[=&lt;encoding&gt;]
947</dt>
948<dd>
949<p>
950 The commit objects record the encoding used for the log message
951 in their encoding header; this option can be used to tell the
952 command to re-code the commit log message in the encoding
953 preferred by the user. For non plumbing commands this
954 defaults to UTF-8.
955</p>
956</dd>
957<dt>
958--no-commit-id
959</dt>
960<dd>
961<p>
Junio C Hamanoba4b9282008-07-06 05:20:31962 <em>git-diff-tree</em> outputs a line with the commit ID when
Junio C Hamano0430e3a2007-05-15 03:13:17963 applicable. This flag suppressed the commit ID output.
964</p>
965</dd>
966<dt>
967-c
968</dt>
969<dd>
970<p>
971 This flag changes the way a merge commit is displayed
972 (which means it is useful only when the command is given
973 one &lt;tree-ish&gt;, or <em>--stdin</em>). It shows the differences
974 from each of the parents to the merge result simultaneously
975 instead of showing pairwise diff between a parent and the
976 result one at a time (which is what the <em>-m</em> option does).
977 Furthermore, it lists only files which were modified
978 from all parents.
979</p>
980</dd>
981<dt>
982--cc
983</dt>
984<dd>
985<p>
986 This flag changes the way a merge commit patch is displayed,
987 in a similar way to the <em>-c</em> option. It implies the <em>-c</em>
988 and <em>-p</em> options and further compresses the patch output
Junio C Hamanoccc2f762008-07-24 04:03:33989 by omitting uninteresting hunks whose the contents in the parents
990 have only two variants and the merge result picks one of them
991 without modification. When all hunks are uninteresting, the commit
992 itself and the commit log message is not shown, just like in any other
993 "empty diff" case.
Junio C Hamano0430e3a2007-05-15 03:13:17994</p>
995</dd>
996<dt>
997--always
998</dt>
999<dd>
1000<p>
1001 Show the commit itself and the commit log message even
1002 if the diff itself is empty.
1003</p>
1004</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311005</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:171006</div>
Junio C Hamanoba4b9282008-07-06 05:20:311007<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:171008<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311009<div class="para"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:171010is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1011inserted before the <em>Author:</em> line. This line begins with
1012"Merge: " and the sha1s of ancestral commits are printed,
1013separated by spaces. Note that the listed commits may not
1014necessarily be the list of the <strong>direct</strong> parent commits if you
1015have limited your view of history: for example, if you are
1016only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:311017file.</p></div>
1018<div class="para"><p>Here are some additional details for each format:</p></div>
1019<div class="ilist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:331020<li>
1021<p>
1022<em>oneline</em>
1023</p>
1024<div class="literalblock">
1025<div class="content">
1026<pre><tt>&lt;sha1&gt; &lt;title line&gt;</tt></pre>
1027</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311028<div class="para"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:331029</li>
1030<li>
1031<p>
1032<em>short</em>
1033</p>
1034<div class="literalblock">
1035<div class="content">
1036<pre><tt>commit &lt;sha1&gt;
1037Author: &lt;author&gt;</tt></pre>
1038</div></div>
1039<div class="literalblock">
1040<div class="content">
1041<pre><tt>&lt;title line&gt;</tt></pre>
1042</div></div>
1043</li>
1044<li>
1045<p>
1046<em>medium</em>
1047</p>
1048<div class="literalblock">
1049<div class="content">
1050<pre><tt>commit &lt;sha1&gt;
1051Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311052Date: &lt;author date&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331053</div></div>
1054<div class="literalblock">
1055<div class="content">
1056<pre><tt>&lt;title line&gt;</tt></pre>
1057</div></div>
1058<div class="literalblock">
1059<div class="content">
1060<pre><tt>&lt;full commit message&gt;</tt></pre>
1061</div></div>
1062</li>
1063<li>
1064<p>
1065<em>full</em>
1066</p>
1067<div class="literalblock">
1068<div class="content">
1069<pre><tt>commit &lt;sha1&gt;
1070Author: &lt;author&gt;
1071Commit: &lt;committer&gt;</tt></pre>
1072</div></div>
1073<div class="literalblock">
1074<div class="content">
1075<pre><tt>&lt;title line&gt;</tt></pre>
1076</div></div>
1077<div class="literalblock">
1078<div class="content">
1079<pre><tt>&lt;full commit message&gt;</tt></pre>
1080</div></div>
1081</li>
1082<li>
1083<p>
1084<em>fuller</em>
1085</p>
1086<div class="literalblock">
1087<div class="content">
1088<pre><tt>commit &lt;sha1&gt;
1089Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311090AuthorDate: &lt;author date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:331091Commit: &lt;committer&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311092CommitDate: &lt;committer date&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331093</div></div>
1094<div class="literalblock">
1095<div class="content">
1096<pre><tt>&lt;title line&gt;</tt></pre>
1097</div></div>
1098<div class="literalblock">
1099<div class="content">
1100<pre><tt>&lt;full commit message&gt;</tt></pre>
1101</div></div>
1102</li>
1103<li>
1104<p>
1105<em>email</em>
1106</p>
1107<div class="literalblock">
1108<div class="content">
1109<pre><tt>From &lt;sha1&gt; &lt;date&gt;
1110From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311111Date: &lt;author date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:331112Subject: [PATCH] &lt;title line&gt;</tt></pre>
1113</div></div>
1114<div class="literalblock">
1115<div class="content">
Junio C Hamano0430e3a2007-05-15 03:13:171116<pre><tt>&lt;full commit message&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331117</div></div>
1118</li>
1119<li>
1120<p>
1121<em>raw</em>
1122</p>
Junio C Hamanoba4b9282008-07-06 05:20:311123<div class="para"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanoa340aaa2006-11-23 02:47:331124stored in the commit object. Notably, the SHA1s are
1125displayed in full, regardless of whether --abbrev or
1126--no-abbrev are used, and <em>parents</em> information show the
1127true parent commits, without taking grafts nor history
Junio C Hamanoba4b9282008-07-06 05:20:311128simplification into account.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:331129</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:361130<li>
1131<p>
1132<em>format:</em>
1133</p>
Junio C Hamanoba4b9282008-07-06 05:20:311134<div class="para"><p>The <em>format:</em> format allows you to specify which information
Junio C Hamanoa3fd83c2007-03-02 10:34:361135you want to show. It works a little bit like printf format,
1136with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:311137instead of <em>\n</em>.</p></div>
1138<div class="para"><p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</em>
1139would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:171140<div class="listingblock">
1141<div class="content">
1142<pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago
1143The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;
1144</tt></pre>
1145</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311146<div class="para"><p>The placeholders are:</p></div>
1147<div class="ilist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:361148<li>
1149<p>
1150<em>%H</em>: commit hash
1151</p>
1152</li>
1153<li>
1154<p>
1155<em>%h</em>: abbreviated commit hash
1156</p>
1157</li>
1158<li>
1159<p>
1160<em>%T</em>: tree hash
1161</p>
1162</li>
1163<li>
1164<p>
1165<em>%t</em>: abbreviated tree hash
1166</p>
1167</li>
1168<li>
1169<p>
1170<em>%P</em>: parent hashes
1171</p>
1172</li>
1173<li>
1174<p>
1175<em>%p</em>: abbreviated parent hashes
1176</p>
1177</li>
1178<li>
1179<p>
1180<em>%an</em>: author name
1181</p>
1182</li>
1183<li>
1184<p>
Junio C Hamanof5a93622008-07-16 03:23:571185<em>%aN</em>: author name (respecting .mailmap)
1186</p>
1187</li>
1188<li>
1189<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361190<em>%ae</em>: author email
1191</p>
1192</li>
1193<li>
1194<p>
Junio C Hamanoa387df32008-08-29 08:56:581195<em>%ad</em>: author date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:361196</p>
1197</li>
1198<li>
1199<p>
1200<em>%aD</em>: author date, RFC2822 style
1201</p>
1202</li>
1203<li>
1204<p>
1205<em>%ar</em>: author date, relative
1206</p>
1207</li>
1208<li>
1209<p>
1210<em>%at</em>: author date, UNIX timestamp
1211</p>
1212</li>
1213<li>
1214<p>
Junio C Hamano02f130b2007-07-14 08:26:561215<em>%ai</em>: author date, ISO 8601 format
1216</p>
1217</li>
1218<li>
1219<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361220<em>%cn</em>: committer name
1221</p>
1222</li>
1223<li>
1224<p>
Junio C Hamanof5a93622008-07-16 03:23:571225<em>%cN</em>: committer name (respecting .mailmap)
1226</p>
1227</li>
1228<li>
1229<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361230<em>%ce</em>: committer email
1231</p>
1232</li>
1233<li>
1234<p>
1235<em>%cd</em>: committer date
1236</p>
1237</li>
1238<li>
1239<p>
1240<em>%cD</em>: committer date, RFC2822 style
1241</p>
1242</li>
1243<li>
1244<p>
1245<em>%cr</em>: committer date, relative
1246</p>
1247</li>
1248<li>
1249<p>
1250<em>%ct</em>: committer date, UNIX timestamp
1251</p>
1252</li>
1253<li>
1254<p>
Junio C Hamano02f130b2007-07-14 08:26:561255<em>%ci</em>: committer date, ISO 8601 format
1256</p>
1257</li>
1258<li>
1259<p>
Junio C Hamano5e4d8de2008-09-19 06:27:021260<em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
1261</p>
1262</li>
1263<li>
1264<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361265<em>%e</em>: encoding
1266</p>
1267</li>
1268<li>
1269<p>
1270<em>%s</em>: subject
1271</p>
1272</li>
1273<li>
1274<p>
1275<em>%b</em>: body
1276</p>
1277</li>
1278<li>
1279<p>
1280<em>%Cred</em>: switch color to red
1281</p>
1282</li>
1283<li>
1284<p>
1285<em>%Cgreen</em>: switch color to green
1286</p>
1287</li>
1288<li>
1289<p>
1290<em>%Cblue</em>: switch color to blue
1291</p>
1292</li>
1293<li>
1294<p>
1295<em>%Creset</em>: reset color
1296</p>
1297</li>
1298<li>
1299<p>
Junio C Hamanod9e0e5d2007-04-14 16:22:041300<em>%m</em>: left, right or boundary mark
1301</p>
1302</li>
1303<li>
1304<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361305<em>%n</em>: newline
1306</p>
Junio C Hamano0430e3a2007-05-15 03:13:171307</li>
Junio C Hamanob78d2592008-04-09 09:39:081308<li>
1309<p>
1310<em>%x00</em>: print a byte from a hex code
1311</p>
1312</li>
Junio C Hamanoba4b9282008-07-06 05:20:311313</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:361314</li>
Junio C Hamano6fb124c2008-06-13 10:04:011315<li>
1316<p>
1317<em>tformat:</em>
1318</p>
Junio C Hamanoba4b9282008-07-06 05:20:311319<div class="para"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
Junio C Hamano6fb124c2008-06-13 10:04:011320provides "terminator" semantics instead of "separator" semantics. In
1321other words, each commit has the message terminator character (usually a
1322newline) appended, rather than a separator placed between entries.
1323This means that the final entry of a single-line format will be properly
1324terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:311325For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:011326<div class="listingblock">
1327<div class="content">
1328<pre><tt>$ git log -2 --pretty=format:%h 4da45bef \
1329 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
13304da45be
13317134973 -- NO NEWLINE
1332
1333$ git log -2 --pretty=tformat:%h 4da45bef \
1334 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
13354da45be
13367134973</tt></pre>
1337</div></div>
1338</li>
Junio C Hamanoba4b9282008-07-06 05:20:311339</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:231340</div>
Junio C Hamanoba4b9282008-07-06 05:20:311341<h2 id="_limiting_output">Limiting Output</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231342<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311343<div class="para"><p>If you're only interested in differences in a subset of files, for
1344example some architecture-specific files, you might do:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231345<div class="literalblock">
1346<div class="content">
Junio C Hamanofce7c7e2008-07-02 03:06:381347<pre><tt>git diff-tree -r &lt;tree-ish&gt; &lt;tree-ish&gt; arch/ia64 include/asm-ia64</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231348</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311349<div class="para"><p>and it will only show you what changed in those two directories.</p></div>
1350<div class="para"><p>Or if you are searching for what changed in just <tt>kernel/sched.c</tt>, just do</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231351<div class="literalblock">
1352<div class="content">
Junio C Hamanofce7c7e2008-07-02 03:06:381353<pre><tt>git diff-tree -r &lt;tree-ish&gt; &lt;tree-ish&gt; kernel/sched.c</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231354</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311355<div class="para"><p>and it will ignore all differences to other files.</p></div>
1356<div class="para"><p>The pattern is always the prefix, and is matched exactly. There are no
Junio C Hamano1a4e8412005-12-27 08:17:231357wildcards. Even stricter, it has to match a complete path component.
1358I.e. "foo" does not pick up <tt>foobar.h</tt>. "foo" does match <tt>foo/bar.h</tt>
Junio C Hamanoba4b9282008-07-06 05:20:311359so it can be used to name subdirectories.</p></div>
1360<div class="para"><p>An example of normal usage is:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231361<div class="literalblock">
1362<div class="content">
Junio C Hamanofce7c7e2008-07-02 03:06:381363<pre><tt>torvalds@ppc970:~/git&gt; git diff-tree 5319e4......
Junio C Hamano1a4e8412005-12-27 08:17:231364*100664-&gt;100664 blob ac348b.......-&gt;a01513....... git-fsck-objects.c</tt></pre>
1365</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311366<div class="para"><p>which tells you that the last commit changed just one file (it's from
1367this one:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231368<div class="listingblock">
1369<div class="content">
1370<pre><tt>commit 3c6f7ca19ad4043e9e72fa94106f352897e651a8
1371tree 5319e4d609cdd282069cc4dce33c1db559539b03
1372parent b4e628ea30d5ab3606119d2ea5caeab141d38df7
1373author Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
1374committer Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
1375
1376Make "git-fsck-objects" print out all the root commits it finds.
1377
1378Once I do the reference tracking, I'll also make it print out all the
1379HEAD commits it finds, which is even more interesting.</tt></pre>
1380</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311381<div class="para"><p>in case you care).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231382</div>
Junio C Hamanoba4b9282008-07-06 05:20:311383<h2 id="_output_format">Output format</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231384<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311385<div class="para"><p>The output format from "git-diff-index", "git-diff-tree",
1386"git-diff-files" and "git diff --raw" are very similar.</p></div>
1387<div class="para"><p>These commands all compare two sets of things; what is
1388compared differs:</p></div>
1389<div class="vlist"><dl>
Junio C Hamano1a4e8412005-12-27 08:17:231390<dt>
1391git-diff-index &lt;tree-ish&gt;
1392</dt>
1393<dd>
1394<p>
1395 compares the &lt;tree-ish&gt; and the files on the filesystem.
1396</p>
1397</dd>
1398<dt>
1399git-diff-index --cached &lt;tree-ish&gt;
1400</dt>
1401<dd>
1402<p>
1403 compares the &lt;tree-ish&gt; and the index.
1404</p>
1405</dd>
1406<dt>
1407git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
1408</dt>
1409<dd>
1410<p>
1411 compares the trees named by the two arguments.
1412</p>
1413</dd>
1414<dt>
1415git-diff-files [&lt;pattern&gt;&#8230;]
1416</dt>
1417<dd>
1418<p>
1419 compares the index and the files on the filesystem.
1420</p>
1421</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311422</dl></div>
1423<div class="para"><p>An output line is formatted this way:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231424<div class="listingblock">
1425<div class="content">
1426<pre><tt>in-place edit :100644 100644 bcd1234... 0123456... M file0
1427copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
1428rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
1429create :000000 100644 0000000... 1234567... A file4
1430delete :100644 000000 1234567... 0000000... D file5
1431unmerged :000000 000000 0000000... 0000000... U file6</tt></pre>
1432</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311433<div class="para"><p>That is, from the left to the right:</p></div>
1434<div class="olist"><ol>
Junio C Hamano1a4e8412005-12-27 08:17:231435<li>
1436<p>
1437a colon.
1438</p>
1439</li>
1440<li>
1441<p>
1442mode for "src"; 000000 if creation or unmerged.
1443</p>
1444</li>
1445<li>
1446<p>
1447a space.
1448</p>
1449</li>
1450<li>
1451<p>
1452mode for "dst"; 000000 if deletion or unmerged.
1453</p>
1454</li>
1455<li>
1456<p>
1457a space.
1458</p>
1459</li>
1460<li>
1461<p>
1462sha1 for "src"; 0{40} if creation or unmerged.
1463</p>
1464</li>
1465<li>
1466<p>
1467a space.
1468</p>
1469</li>
1470<li>
1471<p>
1472sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
1473</p>
1474</li>
1475<li>
1476<p>
1477a space.
1478</p>
1479</li>
1480<li>
1481<p>
1482status, followed by optional "score" number.
1483</p>
1484</li>
1485<li>
1486<p>
1487a tab or a NUL when <em>-z</em> option is used.
1488</p>
1489</li>
1490<li>
1491<p>
1492path for "src"
1493</p>
1494</li>
1495<li>
1496<p>
1497a tab or a NUL when <em>-z</em> option is used; only exists for C or R.
1498</p>
1499</li>
1500<li>
1501<p>
1502path for "dst"; only exists for C or R.
1503</p>
1504</li>
1505<li>
1506<p>
1507an LF or a NUL when <em>-z</em> option is used, to terminate the record.
1508</p>
1509</li>
Junio C Hamanoba4b9282008-07-06 05:20:311510</ol></div>
Junio C Hamanoaa17c7c2008-11-03 04:36:581511<div class="para"><p>Possible status letters are:</p></div>
1512<div class="ilist"><ul>
1513<li>
1514<p>
1515A: addition of a file
1516</p>
1517</li>
1518<li>
1519<p>
1520C: copy of a file into a new one
1521</p>
1522</li>
1523<li>
1524<p>
1525D: deletion of a file
1526</p>
1527</li>
1528<li>
1529<p>
1530M: modification of the contents or mode of a file
1531</p>
1532</li>
1533<li>
1534<p>
1535R: renaming of a file
1536</p>
1537</li>
1538<li>
1539<p>
1540T: change in the type of the file
1541</p>
1542</li>
1543<li>
1544<p>
1545U: file is unmerged (you must complete the merge before it can
1546be committed)
1547</p>
1548</li>
1549<li>
1550<p>
1551X: "unknown" change type (most probably a bug, please report it)
1552</p>
1553</li>
1554</ul></div>
1555<div class="para"><p>Status letters C and M are always followed by a score (denoting the
1556percentage of similarity between the source and target of the move or
1557copy), and are the only ones to be so.</p></div>
Junio C Hamanoba4b9282008-07-06 05:20:311558<div class="para"><p>&lt;sha1&gt; is shown as all 0's if a file is new on the filesystem
1559and it is out of sync with the index.</p></div>
1560<div class="para"><p>Example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231561<div class="listingblock">
1562<div class="content">
1563<pre><tt>:100644 100644 5be4a4...... 000000...... M file.c</tt></pre>
1564</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311565<div class="para"><p>When <tt>-z</tt> option is not used, TAB, LF, and backslash characters
Junio C Hamano1a4e8412005-12-27 08:17:231566in pathnames are represented as <tt>\t</tt>, <tt>\n</tt>, and <tt>\\</tt>,
Junio C Hamanoba4b9282008-07-06 05:20:311567respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231568</div>
Junio C Hamanoba4b9282008-07-06 05:20:311569<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano67fad6d2007-05-06 08:53:121570<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311571<div class="para"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano7ae0ab22007-11-03 02:46:461572can take <em>-c</em> or <em>--cc</em> option
Junio C Hamano67fad6d2007-05-06 08:53:121573to generate diff output also for merge commits. The output differs
Junio C Hamanoba4b9282008-07-06 05:20:311574from the format described above in the following way:</p></div>
1575<div class="olist"><ol>
Junio C Hamano67fad6d2007-05-06 08:53:121576<li>
1577<p>
1578there is a colon for each parent
1579</p>
1580</li>
1581<li>
1582<p>
1583there are more "src" modes and "src" sha1
1584</p>
1585</li>
1586<li>
1587<p>
1588status is concatenated status characters for each parent
1589</p>
1590</li>
1591<li>
1592<p>
1593no optional "score" number
1594</p>
1595</li>
1596<li>
1597<p>
1598single path, only for "dst"
1599</p>
1600</li>
Junio C Hamanoba4b9282008-07-06 05:20:311601</ol></div>
1602<div class="para"><p>Example:</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:121603<div class="listingblock">
1604<div class="content">
1605<pre><tt>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</tt></pre>
1606</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311607<div class="para"><p>Note that <em>combined diff</em> lists only files which were modified from
1608all parents.</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:121609</div>
Junio C Hamanoba4b9282008-07-06 05:20:311610<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231611<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311612<div class="para"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano00b8b632007-12-07 09:50:491613with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
1614"git log" with the "-p" option, they
Junio C Hamano7ae0ab22007-11-03 02:46:461615do not produce the output described above; instead they produce a
1616patch file. You can customize the creation of such patches via the
Junio C Hamanoba4b9282008-07-06 05:20:311617GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
1618<div class="para"><p>What the -p option produces is slightly different from the traditional
1619diff format.</p></div>
1620<div class="olist"><ol>
Junio C Hamano1a4e8412005-12-27 08:17:231621<li>
1622<p>
Junio C Hamano235a91e2006-01-07 01:13:581623It is preceded with a "git diff" header, that looks like
Junio C Hamano1a4e8412005-12-27 08:17:231624 this:
1625</p>
1626<div class="literalblock">
1627<div class="content">
1628<pre><tt>diff --git a/file1 b/file2</tt></pre>
1629</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311630<div class="para"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is
Junio C Hamano1a4e8412005-12-27 08:17:231631involved. Especially, even for a creation or a deletion,
Junio C Hamano5e4d8de2008-09-19 06:27:021632<tt>/dev/null</tt> is _not_ used in place of <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>
Junio C Hamanoba4b9282008-07-06 05:20:311633<div class="para"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the
Junio C Hamano1a4e8412005-12-27 08:17:231634name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:311635the file that rename/copy produces, respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231636</li>
1637<li>
1638<p>
1639It is followed by one or more extended header lines:
1640</p>
1641<div class="literalblock">
1642<div class="content">
1643<pre><tt>old mode &lt;mode&gt;
1644new mode &lt;mode&gt;
1645deleted file mode &lt;mode&gt;
1646new file mode &lt;mode&gt;
1647copy from &lt;path&gt;
1648copy to &lt;path&gt;
1649rename from &lt;path&gt;
1650rename to &lt;path&gt;
1651similarity index &lt;number&gt;
1652dissimilarity index &lt;number&gt;
1653index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</tt></pre>
1654</div></div>
1655</li>
1656<li>
1657<p>
Junio C Hamanoa053d542006-10-27 09:29:131658TAB, LF, double quote and backslash characters in pathnames
1659 are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively.
1660 If there is need for such substitution then the whole
1661 pathname is put in double quotes.
Junio C Hamano1a4e8412005-12-27 08:17:231662</p>
1663</li>
Junio C Hamanoba4b9282008-07-06 05:20:311664</ol></div>
1665<div class="para"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamanod526ba92007-07-02 00:17:421666the dissimilarity index is the percentage of changed lines. It
1667is a rounded down integer, followed by a percent sign. The
1668similarity index value of 100% is thus reserved for two equal
1669files, while 100% dissimilarity means that no line from the old
Junio C Hamanoba4b9282008-07-06 05:20:311670file made it into the new one.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231671</div>
Junio C Hamanoba4b9282008-07-06 05:20:311672<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamanofb56a962006-01-28 10:38:191673<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311674<div class="para"><p>"git-diff-tree", "git-diff-files" and "git-diff" can take <em>-c</em> or
Junio C Hamano00b8b632007-12-07 09:50:491675<em>--cc</em> option to produce <em>combined diff</em>. For showing a merge commit
1676with "git log -p", this is the default format.
Junio C Hamanoba4b9282008-07-06 05:20:311677A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamanofb56a962006-01-28 10:38:191678<div class="listingblock">
1679<div class="content">
1680<pre><tt>diff --combined describe.c
Junio C Hamano29f14312006-10-26 08:47:291681index fabadb8,cc95eb0..4866510
1682--- a/describe.c
1683+++ b/describe.c
1684@@@ -98,20 -98,12 +98,20 @@@
1685 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
Junio C Hamanofb56a962006-01-28 10:38:191686 }
1687
1688- static void describe(char *arg)
1689 -static void describe(struct commit *cmit, int last_one)
1690++static void describe(char *arg, int last_one)
1691 {
Junio C Hamano29f14312006-10-26 08:47:291692 + unsigned char sha1[20];
1693 + struct commit *cmit;
1694 struct commit_list *list;
1695 static int initialized = 0;
1696 struct commit_name *n;
1697
1698 + if (get_sha1(arg, sha1) &lt; 0)
1699 + usage(describe_usage);
1700 + cmit = lookup_commit_reference(sha1);
1701 + if (!cmit)
1702 + usage(describe_usage);
1703 +
1704 if (!initialized) {
1705 initialized = 1;
1706 for_each_ref(get_name);</tt></pre>
Junio C Hamanofb56a962006-01-28 10:38:191707</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311708<div class="olist"><ol>
Junio C Hamano29f14312006-10-26 08:47:291709<li>
1710<p>
1711It is preceded with a "git diff" header, that looks like
1712 this (when <em>-c</em> option is used):
1713</p>
1714<div class="literalblock">
1715<div class="content">
1716<pre><tt>diff --combined file</tt></pre>
1717</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311718<div class="para"><p>or like this (when <em>--cc</em> option is used):</p></div>
Junio C Hamano29f14312006-10-26 08:47:291719<div class="literalblock">
1720<div class="content">
Junio C Hamano0868a302008-07-22 09:20:441721<pre><tt>diff --cc file</tt></pre>
Junio C Hamano29f14312006-10-26 08:47:291722</div></div>
1723</li>
1724<li>
1725<p>
1726It is followed by one or more extended header lines
1727 (this example shows a merge with two parents):
1728</p>
1729<div class="literalblock">
1730<div class="content">
1731<pre><tt>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
1732mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
1733new file mode &lt;mode&gt;
1734deleted file mode &lt;mode&gt;,&lt;mode&gt;</tt></pre>
1735</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311736<div class="para"><p>The <tt>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</tt> line appears only if at least one of
Junio C Hamanoee1e4282007-02-04 08:32:041737the &lt;mode&gt; is different from the rest. Extended headers with
Junio C Hamano29f14312006-10-26 08:47:291738information about detected contents movement (renames and
1739copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:311740&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:291741</li>
1742<li>
1743<p>
1744It is followed by two-line from-file/to-file header
1745</p>
1746<div class="literalblock">
1747<div class="content">
1748<pre><tt>--- a/file
1749+++ b/file</tt></pre>
1750</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311751<div class="para"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamano29f14312006-10-26 08:47:291752format, <tt>/dev/null</tt> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:311753files.</p></div>
Junio C Hamano29f14312006-10-26 08:47:291754</li>
1755<li>
1756<p>
1757Chunk header format is modified to prevent people from
1758 accidentally feeding it to <tt>patch -p1</tt>. Combined diff format
1759 was created for review of merge commit changes, and was not
1760 meant for apply. The change is similar to the change in the
1761 extended <em>index</em> header:
1762</p>
1763<div class="literalblock">
1764<div class="content">
1765<pre><tt>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</tt></pre>
1766</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311767<div class="para"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk
1768header for combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:291769</li>
Junio C Hamanoba4b9282008-07-06 05:20:311770</ol></div>
1771<div class="para"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamanofb56a962006-01-28 10:38:191772files A and B with a single column that has <tt>-</tt> (minus &#8212;
1773appears in A but removed in B), <tt>+</tt> (plus &#8212; missing in A but
Junio C Hamano29f14312006-10-26 08:47:291774added to B), or <tt>" "</tt> (space &#8212; unchanged) prefix, this format
Junio C Hamanofb56a962006-01-28 10:38:191775compares two or more files file1, file2,&#8230; with one file X, and
1776shows how X differs from each of fileN. One column for each of
1777fileN is prepended to the output line to note how X's line is
Junio C Hamanoba4b9282008-07-06 05:20:311778different from it.</p></div>
1779<div class="para"><p>A <tt>-</tt> character in the column N means that the line appears in
Junio C Hamano29f14312006-10-26 08:47:291780fileN but it does not appear in the result. A <tt>+</tt> character
Junio C Hamanofb56a962006-01-28 10:38:191781in the column N means that the line appears in the last file,
Junio C Hamano29f14312006-10-26 08:47:291782and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:311783added, from the point of view of that parent).</p></div>
1784<div class="para"><p>In the above example output, the function signature was changed
Junio C Hamanofb56a962006-01-28 10:38:191785from both files (hence two <tt>-</tt> removals from both file1 and
Junio C Hamano5e4d8de2008-09-19 06:27:021786file2, plus <tt>++</tt> to mean one line that was added does not appear
Junio C Hamanofb56a962006-01-28 10:38:191787in either file1 nor file2). Also two other lines are the same
Junio C Hamano5e4d8de2008-09-19 06:27:021788from file1 but do not appear in file2 (hence prefixed with <tt> +</tt>).</p></div>
Junio C Hamanoba4b9282008-07-06 05:20:311789<div class="para"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a
Junio C Hamanofb56a962006-01-28 10:38:191790merge commit with the merge result (i.e. file1..fileN are the
1791parents). When shown by <tt>git diff-files -c</tt>, it compares the
1792two unresolved merge parents with the working tree file
1793(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:311794"their version").</p></div>
Junio C Hamanofb56a962006-01-28 10:38:191795</div>
Junio C Hamanoba4b9282008-07-06 05:20:311796<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:021797<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311798<div class="para"><p>The <tt>--summary</tt> option describes newly added, deleted, renamed and
Junio C Hamano3a702342007-12-12 21:34:021799copied files. The <tt>--stat</tt> option adds diffstat(1) graph to the
1800output. These options can be combined with other options, such as
Junio C Hamanoba4b9282008-07-06 05:20:311801<tt>-p</tt>, and are meant for human consumption.</p></div>
1802<div class="para"><p>When showing a change that involves a rename or a copy, <tt>--stat</tt> output
Junio C Hamano3a702342007-12-12 21:34:021803formats the pathnames compactly by combining common prefix and suffix of
1804the pathnames. For example, a change that moves <tt>arch/i386/Makefile</tt> to
Junio C Hamanoba4b9282008-07-06 05:20:311805<tt>arch/x86/Makefile</tt> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:021806<div class="listingblock">
1807<div class="content">
1808<pre><tt>arch/{i386 =&gt; x86}/Makefile | 4 +--</tt></pre>
1809</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311810<div class="para"><p>The <tt>--numstat</tt> option gives the diffstat(1) information but is designed
Junio C Hamano3a702342007-12-12 21:34:021811for easier machine consumption. An entry in <tt>--numstat</tt> output looks
Junio C Hamanoba4b9282008-07-06 05:20:311812like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:021813<div class="listingblock">
1814<div class="content">
1815<pre><tt>1 2 README
18163 1 arch/{i386 =&gt; x86}/Makefile</tt></pre>
1817</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311818<div class="para"><p>That is, from left to right:</p></div>
1819<div class="olist"><ol>
Junio C Hamano3a702342007-12-12 21:34:021820<li>
1821<p>
1822the number of added lines;
1823</p>
1824</li>
1825<li>
1826<p>
1827a tab;
1828</p>
1829</li>
1830<li>
1831<p>
1832the number of deleted lines;
1833</p>
1834</li>
1835<li>
1836<p>
1837a tab;
1838</p>
1839</li>
1840<li>
1841<p>
1842pathname (possibly with rename/copy information);
1843</p>
1844</li>
1845<li>
1846<p>
1847a newline.
1848</p>
1849</li>
Junio C Hamanoba4b9282008-07-06 05:20:311850</ol></div>
1851<div class="para"><p>When <tt>-z</tt> output option is in effect, the output is formatted this way:</p></div>
Junio C Hamano3a702342007-12-12 21:34:021852<div class="listingblock">
1853<div class="content">
1854<pre><tt>1 2 README NUL
18553 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</tt></pre>
1856</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311857<div class="para"><p>That is:</p></div>
1858<div class="olist"><ol>
Junio C Hamano3a702342007-12-12 21:34:021859<li>
1860<p>
1861the number of added lines;
1862</p>
1863</li>
1864<li>
1865<p>
1866a tab;
1867</p>
1868</li>
1869<li>
1870<p>
1871the number of deleted lines;
1872</p>
1873</li>
1874<li>
1875<p>
1876a tab;
1877</p>
1878</li>
1879<li>
1880<p>
1881a NUL (only exists if renamed/copied);
1882</p>
1883</li>
1884<li>
1885<p>
1886pathname in preimage;
1887</p>
1888</li>
1889<li>
1890<p>
1891a NUL (only exists if renamed/copied);
1892</p>
1893</li>
1894<li>
1895<p>
1896pathname in postimage (only exists if renamed/copied);
1897</p>
1898</li>
1899<li>
1900<p>
1901a NUL.
1902</p>
1903</li>
Junio C Hamanoba4b9282008-07-06 05:20:311904</ol></div>
1905<div class="para"><p>The extra <tt>NUL</tt> before the preimage path in renamed case is to allow
Junio C Hamano3a702342007-12-12 21:34:021906scripts that read the output to tell if the current record being read is
1907a single-path record or a rename/copy record without reading ahead.
1908After reading added and deleted lines, reading up to <tt>NUL</tt> would yield
Junio C Hamanoba4b9282008-07-06 05:20:311909the pathname, but if that is <tt>NUL</tt>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:021910</div>
Junio C Hamanoba4b9282008-07-06 05:20:311911<h2 id="_author">Author</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231912<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311913<div class="para"><p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231914</div>
Junio C Hamanoba4b9282008-07-06 05:20:311915<h2 id="_documentation">Documentation</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231916<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311917<div class="para"><p>Documentation by David Greaves, Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231918</div>
Junio C Hamanoba4b9282008-07-06 05:20:311919<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231920<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311921<div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231922</div>
1923<div id="footer">
1924<div id="footer-text">
Junio C Hamanoaa17c7c2008-11-03 04:36:581925Last updated 2008-11-03 04:36:23 UTC
Junio C Hamano1a4e8412005-12-27 08:17:231926</div>
1927</div>
1928</body>
1929</html>