blob: fb9ca34746cd1c952552dbcd0aad1ecb1ed79d48 [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-files(1)</title>
308</head>
309<body>
310<div id="header">
311<h1>
312git-diff-files(1) Manual Page
313</h1>
314<h2>NAME</h2>
315<div class="sectionbody">
316<p>git-diff-files -
317 Compares files in the working tree and the index
318</p>
319</div>
320</div>
321<h2>SYNOPSIS</h2>
322<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31323<div class="para"><p><em>git diff-files</em> [-q] [-0|-1|-2|-3|-c|--cc] [&lt;common diff options&gt;] [&lt;path&gt;&#8230;]</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23324</div>
Junio C Hamanoba4b9282008-07-06 05:20:31325<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23326<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31327<div class="para"><p>Compares the files in the working tree and the index. When paths
Junio C Hamano1a4e8412005-12-27 08:17:23328are specified, compares only those named paths. Otherwise all
329entries in the index are compared. The output format is the
Junio C Hamanoba4b9282008-07-06 05:20:31330same as for <em>git-diff-index</em> and <em>git-diff-tree</em>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23331</div>
Junio C Hamanoba4b9282008-07-06 05:20:31332<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23333<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31334<div class="vlist"><dl>
Junio C Hamano1a4e8412005-12-27 08:17:23335<dt>
336-p
337</dt>
338<dd>
339<p>
Junio C Hamanoff979792007-11-16 10:11:30340 Generate patch (see section on generating patches).
341
Junio C Hamano1a4e8412005-12-27 08:17:23342</p>
343</dd>
344<dt>
345-u
346</dt>
347<dd>
348<p>
349 Synonym for "-p".
350</p>
351</dd>
352<dt>
Junio C Hamano69361562007-07-26 02:14:34353-U&lt;n&gt;
354</dt>
355<dd>
356<p>
357 Shorthand for "--unified=&lt;n&gt;".
358</p>
359</dd>
360<dt>
361--unified=&lt;n&gt;
362</dt>
363<dd>
364<p>
365 Generate diffs with &lt;n&gt; lines of context instead of
366 the usual three. Implies "-p".
367</p>
368</dd>
369<dt>
Junio C Hamano9ae1a062006-07-10 08:12:34370--raw
371</dt>
372<dd>
373<p>
374 Generate the raw format.
Junio C Hamanoff979792007-11-16 10:11:30375 This is the default.
Junio C Hamano9ae1a062006-07-10 08:12:34376</p>
377</dd>
378<dt>
Junio C Hamano54559c82006-04-13 07:45:12379--patch-with-raw
380</dt>
381<dd>
382<p>
Junio C Hamano9ae1a062006-07-10 08:12:34383 Synonym for "-p --raw".
Junio C Hamano54559c82006-04-13 07:45:12384</p>
385</dd>
386<dt>
Junio C Hamano4a9a76a2006-10-01 05:40:29387--stat[=width[,name-width]]
Junio C Hamanoba7c8d82006-04-15 06:17:42388</dt>
389<dd>
390<p>
Junio C Hamano4a9a76a2006-10-01 05:40:29391 Generate a diffstat. You can override the default
392 output width for 80-column terminal by "--stat=width".
393 The width of the filename part can be controlled by
394 giving another width to it separated by a comma.
Junio C Hamanoba7c8d82006-04-15 06:17:42395</p>
396</dd>
397<dt>
Junio C Hamanofbe00522006-10-19 05:58:48398--numstat
399</dt>
400<dd>
401<p>
402 Similar to --stat, but shows number of added and
403 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43404 abbreviation, to make it more machine friendly. For
405 binary files, outputs two <tt>-</tt> instead of saying
406 <tt>0 0</tt>.
Junio C Hamanofbe00522006-10-19 05:58:48407</p>
408</dd>
409<dt>
Junio C Hamano7d23f5e2006-12-16 07:44:04410--shortstat
411</dt>
412<dd>
413<p>
414 Output only the last line of the --stat format containing total
415 number of modified files, as well as number of added and deleted
416 lines.
417</p>
418</dd>
419<dt>
Junio C Hamano6a45be92008-04-22 08:19:03420--dirstat[=limit]
421</dt>
422<dd>
423<p>
424 Output only the sub-directories that are impacted by a diff,
425 and to what degree they are impacted. You can override the
426 default cut-off in percent (3) by "--dirstat=limit". If you
427 want to enable "cumulative" directory statistics, you can use
428 the "--cumulative" flag, which adds up percentages recursively
429 even when they have been already reported for a sub-directory.
430</p>
431</dd>
432<dt>
Junio C Hamano6959c6c2006-05-17 10:34:11433--summary
434</dt>
435<dd>
436<p>
437 Output a condensed summary of extended header information
438 such as creations, renames and mode changes.
439</p>
440</dd>
441<dt>
Junio C Hamanod1308c92006-04-16 11:01:09442--patch-with-stat
443</dt>
444<dd>
445<p>
Junio C Hamano9ae1a062006-07-10 08:12:34446 Synonym for "-p --stat".
Junio C Hamanoff979792007-11-16 10:11:30447
Junio C Hamanod1308c92006-04-16 11:01:09448</p>
449</dd>
450<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23451-z
452</dt>
453<dd>
454<p>
Junio C Hamanob968dbb2007-07-27 07:26:40455 NUL-line termination on output. This affects the --raw
456 output field terminator. Also output from commands such
457 as "git-log" will be delimited with NUL between commits.
Junio C Hamano1a4e8412005-12-27 08:17:23458</p>
459</dd>
460<dt>
461--name-only
462</dt>
463<dd>
464<p>
465 Show only names of changed files.
466</p>
467</dd>
468<dt>
469--name-status
470</dt>
471<dd>
472<p>
Junio C Hamanoa9aee782008-04-23 16:09:20473 Show only names and status of changed files. See the description
474 of the <tt>--diff-filter</tt> option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:23475</p>
476</dd>
477<dt>
Junio C Hamano9ae1a062006-07-10 08:12:34478--color
479</dt>
480<dd>
481<p>
482 Show colored diff.
483</p>
484</dd>
485<dt>
486--no-color
487</dt>
488<dd>
489<p>
490 Turn off colored diff, even when the configuration file
491 gives the default to color output.
492</p>
493</dd>
494<dt>
Junio C Hamano85e45fa2006-08-13 07:47:41495--color-words
496</dt>
497<dd>
498<p>
499 Show colored word diff, i.e. color words which have changed.
500</p>
501</dd>
502<dt>
Junio C Hamano9ae1a062006-07-10 08:12:34503--no-renames
504</dt>
505<dd>
506<p>
507 Turn off rename detection, even when the configuration
508 file gives the default to do so.
509</p>
510</dd>
511<dt>
Junio C Hamanoa890c4f2007-01-28 10:29:21512--check
513</dt>
514<dd>
515<p>
516 Warn if changes introduce trailing whitespace
Junio C Hamano3dac5042007-12-15 08:40:54517 or an indent that uses a space before a tab. Exits with
518 non-zero status if problems are found. Not compatible with
519 --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:21520</p>
521</dd>
522<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23523--full-index
524</dt>
525<dd>
526<p>
527 Instead of the first handful characters, show full
528 object name of pre- and post-image blob on the "index"
529 line when generating a patch format output.
530</p>
531</dd>
532<dt>
Junio C Hamano9ae1a062006-07-10 08:12:34533--binary
534</dt>
535<dd>
536<p>
537 In addition to --full-index, output "binary diff" that
538 can be applied with "git apply".
539</p>
540</dd>
541<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23542--abbrev[=&lt;n&gt;]
543</dt>
544<dd>
545<p>
546 Instead of showing the full 40-byte hexadecimal object
547 name in diff-raw format output and diff-tree header
Junio C Hamano235a91e2006-01-07 01:13:58548 lines, show only handful hexdigits prefix. This is
Junio C Hamano1a4e8412005-12-27 08:17:23549 independent of --full-index option above, which controls
550 the diff-patch output format. Non default number of
551 digits can be specified with --abbrev=&lt;n&gt;.
552</p>
553</dd>
554<dt>
555-B
556</dt>
557<dd>
558<p>
559 Break complete rewrite changes into pairs of delete and create.
560</p>
561</dd>
562<dt>
563-M
564</dt>
565<dd>
566<p>
567 Detect renames.
568</p>
569</dd>
570<dt>
571-C
572</dt>
573<dd>
574<p>
Junio C Hamano16f98872007-06-12 16:09:14575 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
Junio C Hamano1a4e8412005-12-27 08:17:23576</p>
577</dd>
578<dt>
Junio C Hamano6ec31b92006-02-10 05:52:01579--diff-filter=[ACDMRTUXB*]
580</dt>
581<dd>
582<p>
583 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
584 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
585 type (mode) changed (<tt>T</tt>), are Unmerged (<tt>U</tt>), are
586 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
587 Any combination of the filter characters may be used.
588 When <tt>*</tt> (All-or-none) is added to the combination, all
589 paths are selected if there is any file that matches
590 other criteria in the comparison; if there is no file
591 that matches other criteria, nothing is selected.
592</p>
593</dd>
594<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23595--find-copies-harder
596</dt>
597<dd>
598<p>
Junio C Hamano16f98872007-06-12 16:09:14599 For performance reasons, by default, <tt>-C</tt> option finds copies only
Junio C Hamano1a4e8412005-12-27 08:17:23600 if the original file of the copy was modified in the same
601 changeset. This flag makes the command
602 inspect unmodified files as candidates for the source of
603 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:14604 projects, so use it with caution. Giving more than one
605 <tt>-C</tt> option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:23606</p>
607</dd>
608<dt>
609-l&lt;num&gt;
610</dt>
611<dd>
612<p>
613 -M and -C options require O(n^2) processing time where n
614 is the number of potential rename/copy targets. This
615 option prevents rename/copy detection from running if
616 the number of rename/copy targets exceeds the specified
617 number.
618</p>
619</dd>
620<dt>
621-S&lt;string&gt;
622</dt>
623<dd>
624<p>
625 Look for differences that contain the change in &lt;string&gt;.
626</p>
627</dd>
628<dt>
629--pickaxe-all
630</dt>
631<dd>
632<p>
633 When -S finds a change, show all the changes in that
634 changeset, not just the files that contain the change
635 in &lt;string&gt;.
636</p>
637</dd>
638<dt>
Junio C Hamanobfe9e752006-04-05 21:43:28639--pickaxe-regex
640</dt>
641<dd>
642<p>
643 Make the &lt;string&gt; not a plain string but an extended POSIX
644 regex to match.
645</p>
646</dd>
647<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23648-O&lt;orderfile&gt;
649</dt>
650<dd>
651<p>
652 Output the patch in the order specified in the
653 &lt;orderfile&gt;, which has one shell glob pattern per line.
654</p>
655</dd>
656<dt>
657-R
658</dt>
659<dd>
660<p>
661 Swap two inputs; that is, show differences from index or
662 on-disk file to tree contents.
663</p>
664</dd>
Junio C Hamanoc26f5482006-07-09 09:38:14665<dt>
Junio C Hamano24bc09a2008-02-28 00:27:44666--relative[=&lt;path&gt;]
667</dt>
668<dd>
669<p>
670 When run from a subdirectory of the project, it can be
671 told to exclude changes outside the directory and show
672 pathnames relative to it with this option. When you are
673 not in a subdirectory (e.g. in a bare repository), you
674 can name which subdirectory to make the output relative
675 to by giving a &lt;path&gt; as an argument.
676</p>
677</dd>
678<dt>
Junio C Hamanoc26f5482006-07-09 09:38:14679--text
680</dt>
681<dd>
682<p>
683 Treat all files as text.
684</p>
685</dd>
686<dt>
687-a
688</dt>
689<dd>
690<p>
691 Shorthand for "--text".
692</p>
693</dd>
Junio C Hamanod9c2d2f2006-12-06 08:59:07694<dt>
Junio C Hamanofd468962007-02-14 23:45:04695--ignore-space-at-eol
696</dt>
697<dd>
698<p>
Junio C Hamano3a702342007-12-12 21:34:02699 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:04700</p>
701</dd>
702<dt>
Junio C Hamanod9c2d2f2006-12-06 08:59:07703--ignore-space-change
704</dt>
705<dd>
706<p>
Junio C Hamano3a702342007-12-12 21:34:02707 Ignore changes in amount of whitespace. This ignores whitespace
708 at line end, and considers all other sequences of one or
709 more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:07710</p>
711</dd>
712<dt>
713-b
714</dt>
715<dd>
716<p>
717 Shorthand for "--ignore-space-change".
718</p>
719</dd>
720<dt>
721--ignore-all-space
722</dt>
723<dd>
724<p>
Junio C Hamano3a702342007-12-12 21:34:02725 Ignore whitespace when comparing lines. This ignores
726 differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:07727 line has none.
728</p>
729</dd>
730<dt>
731-w
732</dt>
733<dd>
734<p>
735 Shorthand for "--ignore-all-space".
736</p>
737</dd>
Junio C Hamano48fd2f62007-03-19 02:02:30738<dt>
739--exit-code
740</dt>
741<dd>
742<p>
743 Make the program exit with codes similar to diff(1).
744 That is, it exits with 1 if there were differences and
745 0 means no differences.
746</p>
747</dd>
Junio C Hamano35e57552007-03-25 07:54:35748<dt>
749--quiet
750</dt>
751<dd>
752<p>
753 Disable all output of the program. Implies --exit-code.
754</p>
755</dd>
Junio C Hamanobb0f4042007-07-04 06:41:40756<dt>
757--ext-diff
758</dt>
759<dd>
760<p>
761 Allow an external diff helper to be executed. If you set an
Junio C Hamano1b50ce92007-10-03 12:05:53762 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
763 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:40764</p>
765</dd>
766<dt>
767--no-ext-diff
768</dt>
769<dd>
770<p>
771 Disallow external diff drivers.
772</p>
773</dd>
Junio C Hamanoe27cbd22007-12-21 17:57:33774<dt>
Junio C Hamanodfccbb02008-05-26 01:16:14775--ignore-submodules
776</dt>
777<dd>
778<p>
779 Ignore changes to submodules in the diff generation.
780</p>
781</dd>
782<dt>
Junio C Hamanoe27cbd22007-12-21 17:57:33783--src-prefix=&lt;prefix&gt;
784</dt>
785<dd>
786<p>
787 Show the given source prefix instead of "a/".
788</p>
789</dd>
790<dt>
791--dst-prefix=&lt;prefix&gt;
792</dt>
793<dd>
794<p>
795 Show the given destination prefix instead of "b/".
796</p>
797</dd>
798<dt>
799--no-prefix
800</dt>
801<dd>
802<p>
803 Do not show any source or destination prefix.
804</p>
805</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31806</dl></div>
807<div class="para"><p>For more detailed explanation on these common options, see also
808<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
809<div class="vlist"><dl>
Junio C Hamano1a4e8412005-12-27 08:17:23810<dt>
811-1 -2 -3 or --base --ours --theirs, and -0
812</dt>
813<dd>
814<p>
815 Diff against the "base" version, "our branch" or "their
816 branch" respectively. With these options, diffs for
817 merged entries are not shown.
818</p>
Junio C Hamanoba4b9282008-07-06 05:20:31819<div class="para"><p>The default is to diff against our branch (-2) and the
Junio C Hamano1a4e8412005-12-27 08:17:23820cleanly resolved paths. The option -0 can be given to
Junio C Hamanoba4b9282008-07-06 05:20:31821omit diff output for unmerged entries and just show "Unmerged".</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23822</dd>
823<dt>
Junio C Hamanoeb415992008-06-08 22:49:47824-c
825</dt>
826<dt>
827--cc
Junio C Hamanofb56a962006-01-28 10:38:19828</dt>
829<dd>
830<p>
831 This compares stage 2 (our branch), stage 3 (their
832 branch) and the working tree file and outputs a combined
833 diff, similar to the way <em>diff-tree</em> shows a merge
834 commit with these flags.
835</p>
836</dd>
837<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23838-q
839</dt>
840<dd>
841<p>
Junio C Hamano51c2ab02006-07-09 20:38:54842 Remain silent even on nonexistent files
Junio C Hamano1a4e8412005-12-27 08:17:23843</p>
844</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31845</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:23846</div>
Junio C Hamanoba4b9282008-07-06 05:20:31847<h2 id="_output_format">Output format</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23848<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31849<div class="para"><p>The output format from "git-diff-index", "git-diff-tree",
850"git-diff-files" and "git diff --raw" are very similar.</p></div>
851<div class="para"><p>These commands all compare two sets of things; what is
852compared differs:</p></div>
853<div class="vlist"><dl>
Junio C Hamano1a4e8412005-12-27 08:17:23854<dt>
855git-diff-index &lt;tree-ish&gt;
856</dt>
857<dd>
858<p>
859 compares the &lt;tree-ish&gt; and the files on the filesystem.
860</p>
861</dd>
862<dt>
863git-diff-index --cached &lt;tree-ish&gt;
864</dt>
865<dd>
866<p>
867 compares the &lt;tree-ish&gt; and the index.
868</p>
869</dd>
870<dt>
871git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
872</dt>
873<dd>
874<p>
875 compares the trees named by the two arguments.
876</p>
877</dd>
878<dt>
879git-diff-files [&lt;pattern&gt;&#8230;]
880</dt>
881<dd>
882<p>
883 compares the index and the files on the filesystem.
884</p>
885</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31886</dl></div>
887<div class="para"><p>An output line is formatted this way:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23888<div class="listingblock">
889<div class="content">
890<pre><tt>in-place edit :100644 100644 bcd1234... 0123456... M file0
891copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
892rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
893create :000000 100644 0000000... 1234567... A file4
894delete :100644 000000 1234567... 0000000... D file5
895unmerged :000000 000000 0000000... 0000000... U file6</tt></pre>
896</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:31897<div class="para"><p>That is, from the left to the right:</p></div>
898<div class="olist"><ol>
Junio C Hamano1a4e8412005-12-27 08:17:23899<li>
900<p>
901a colon.
902</p>
903</li>
904<li>
905<p>
906mode for "src"; 000000 if creation or unmerged.
907</p>
908</li>
909<li>
910<p>
911a space.
912</p>
913</li>
914<li>
915<p>
916mode for "dst"; 000000 if deletion or unmerged.
917</p>
918</li>
919<li>
920<p>
921a space.
922</p>
923</li>
924<li>
925<p>
926sha1 for "src"; 0{40} if creation or unmerged.
927</p>
928</li>
929<li>
930<p>
931a space.
932</p>
933</li>
934<li>
935<p>
936sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
937</p>
938</li>
939<li>
940<p>
941a space.
942</p>
943</li>
944<li>
945<p>
946status, followed by optional "score" number.
947</p>
948</li>
949<li>
950<p>
951a tab or a NUL when <em>-z</em> option is used.
952</p>
953</li>
954<li>
955<p>
956path for "src"
957</p>
958</li>
959<li>
960<p>
961a tab or a NUL when <em>-z</em> option is used; only exists for C or R.
962</p>
963</li>
964<li>
965<p>
966path for "dst"; only exists for C or R.
967</p>
968</li>
969<li>
970<p>
971an LF or a NUL when <em>-z</em> option is used, to terminate the record.
972</p>
973</li>
Junio C Hamanoba4b9282008-07-06 05:20:31974</ol></div>
975<div class="para"><p>&lt;sha1&gt; is shown as all 0's if a file is new on the filesystem
976and it is out of sync with the index.</p></div>
977<div class="para"><p>Example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23978<div class="listingblock">
979<div class="content">
980<pre><tt>:100644 100644 5be4a4...... 000000...... M file.c</tt></pre>
981</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:31982<div class="para"><p>When <tt>-z</tt> option is not used, TAB, LF, and backslash characters
Junio C Hamano1a4e8412005-12-27 08:17:23983in pathnames are represented as <tt>\t</tt>, <tt>\n</tt>, and <tt>\\</tt>,
Junio C Hamanoba4b9282008-07-06 05:20:31984respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23985</div>
Junio C Hamanoba4b9282008-07-06 05:20:31986<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano67fad6d2007-05-06 08:53:12987<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31988<div class="para"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano7ae0ab22007-11-03 02:46:46989can take <em>-c</em> or <em>--cc</em> option
Junio C Hamano67fad6d2007-05-06 08:53:12990to generate diff output also for merge commits. The output differs
Junio C Hamanoba4b9282008-07-06 05:20:31991from the format described above in the following way:</p></div>
992<div class="olist"><ol>
Junio C Hamano67fad6d2007-05-06 08:53:12993<li>
994<p>
995there is a colon for each parent
996</p>
997</li>
998<li>
999<p>
1000there are more "src" modes and "src" sha1
1001</p>
1002</li>
1003<li>
1004<p>
1005status is concatenated status characters for each parent
1006</p>
1007</li>
1008<li>
1009<p>
1010no optional "score" number
1011</p>
1012</li>
1013<li>
1014<p>
1015single path, only for "dst"
1016</p>
1017</li>
Junio C Hamanoba4b9282008-07-06 05:20:311018</ol></div>
1019<div class="para"><p>Example:</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:121020<div class="listingblock">
1021<div class="content">
1022<pre><tt>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</tt></pre>
1023</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311024<div class="para"><p>Note that <em>combined diff</em> lists only files which were modified from
1025all parents.</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:121026</div>
Junio C Hamanoba4b9282008-07-06 05:20:311027<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231028<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311029<div class="para"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano00b8b632007-12-07 09:50:491030with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
1031"git log" with the "-p" option, they
Junio C Hamano7ae0ab22007-11-03 02:46:461032do not produce the output described above; instead they produce a
1033patch file. You can customize the creation of such patches via the
Junio C Hamanoba4b9282008-07-06 05:20:311034GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
1035<div class="para"><p>What the -p option produces is slightly different from the traditional
1036diff format.</p></div>
1037<div class="olist"><ol>
Junio C Hamano1a4e8412005-12-27 08:17:231038<li>
1039<p>
Junio C Hamano235a91e2006-01-07 01:13:581040It is preceded with a "git diff" header, that looks like
Junio C Hamano1a4e8412005-12-27 08:17:231041 this:
1042</p>
1043<div class="literalblock">
1044<div class="content">
1045<pre><tt>diff --git a/file1 b/file2</tt></pre>
1046</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311047<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:231048involved. Especially, even for a creation or a deletion,
Junio C Hamanoba4b9282008-07-06 05:20:311049<tt>/dev/null</tt> is <em>not</em> used in place of <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>
1050<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:231051name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:311052the file that rename/copy produces, respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231053</li>
1054<li>
1055<p>
1056It is followed by one or more extended header lines:
1057</p>
1058<div class="literalblock">
1059<div class="content">
1060<pre><tt>old mode &lt;mode&gt;
1061new mode &lt;mode&gt;
1062deleted file mode &lt;mode&gt;
1063new file mode &lt;mode&gt;
1064copy from &lt;path&gt;
1065copy to &lt;path&gt;
1066rename from &lt;path&gt;
1067rename to &lt;path&gt;
1068similarity index &lt;number&gt;
1069dissimilarity index &lt;number&gt;
1070index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</tt></pre>
1071</div></div>
1072</li>
1073<li>
1074<p>
Junio C Hamanoa053d542006-10-27 09:29:131075TAB, LF, double quote and backslash characters in pathnames
1076 are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively.
1077 If there is need for such substitution then the whole
1078 pathname is put in double quotes.
Junio C Hamano1a4e8412005-12-27 08:17:231079</p>
1080</li>
Junio C Hamanoba4b9282008-07-06 05:20:311081</ol></div>
1082<div class="para"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamanod526ba92007-07-02 00:17:421083the dissimilarity index is the percentage of changed lines. It
1084is a rounded down integer, followed by a percent sign. The
1085similarity index value of 100% is thus reserved for two equal
1086files, while 100% dissimilarity means that no line from the old
Junio C Hamanoba4b9282008-07-06 05:20:311087file made it into the new one.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231088</div>
Junio C Hamanoba4b9282008-07-06 05:20:311089<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamanofb56a962006-01-28 10:38:191090<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311091<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:491092<em>--cc</em> option to produce <em>combined diff</em>. For showing a merge commit
1093with "git log -p", this is the default format.
Junio C Hamanoba4b9282008-07-06 05:20:311094A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamanofb56a962006-01-28 10:38:191095<div class="listingblock">
1096<div class="content">
1097<pre><tt>diff --combined describe.c
Junio C Hamano29f14312006-10-26 08:47:291098index fabadb8,cc95eb0..4866510
1099--- a/describe.c
1100+++ b/describe.c
1101@@@ -98,20 -98,12 +98,20 @@@
1102 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
Junio C Hamanofb56a962006-01-28 10:38:191103 }
1104
1105- static void describe(char *arg)
1106 -static void describe(struct commit *cmit, int last_one)
1107++static void describe(char *arg, int last_one)
1108 {
Junio C Hamano29f14312006-10-26 08:47:291109 + unsigned char sha1[20];
1110 + struct commit *cmit;
1111 struct commit_list *list;
1112 static int initialized = 0;
1113 struct commit_name *n;
1114
1115 + if (get_sha1(arg, sha1) &lt; 0)
1116 + usage(describe_usage);
1117 + cmit = lookup_commit_reference(sha1);
1118 + if (!cmit)
1119 + usage(describe_usage);
1120 +
1121 if (!initialized) {
1122 initialized = 1;
1123 for_each_ref(get_name);</tt></pre>
Junio C Hamanofb56a962006-01-28 10:38:191124</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311125<div class="olist"><ol>
Junio C Hamano29f14312006-10-26 08:47:291126<li>
1127<p>
1128It is preceded with a "git diff" header, that looks like
1129 this (when <em>-c</em> option is used):
1130</p>
1131<div class="literalblock">
1132<div class="content">
1133<pre><tt>diff --combined file</tt></pre>
1134</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311135<div class="para"><p>or like this (when <em>--cc</em> option is used):</p></div>
Junio C Hamano29f14312006-10-26 08:47:291136<div class="literalblock">
1137<div class="content">
1138<pre><tt>diff --c file</tt></pre>
1139</div></div>
1140</li>
1141<li>
1142<p>
1143It is followed by one or more extended header lines
1144 (this example shows a merge with two parents):
1145</p>
1146<div class="literalblock">
1147<div class="content">
1148<pre><tt>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
1149mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
1150new file mode &lt;mode&gt;
1151deleted file mode &lt;mode&gt;,&lt;mode&gt;</tt></pre>
1152</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311153<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:041154the &lt;mode&gt; is different from the rest. Extended headers with
Junio C Hamano29f14312006-10-26 08:47:291155information about detected contents movement (renames and
1156copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:311157&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:291158</li>
1159<li>
1160<p>
1161It is followed by two-line from-file/to-file header
1162</p>
1163<div class="literalblock">
1164<div class="content">
1165<pre><tt>--- a/file
1166+++ b/file</tt></pre>
1167</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311168<div class="para"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamano29f14312006-10-26 08:47:291169format, <tt>/dev/null</tt> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:311170files.</p></div>
Junio C Hamano29f14312006-10-26 08:47:291171</li>
1172<li>
1173<p>
1174Chunk header format is modified to prevent people from
1175 accidentally feeding it to <tt>patch -p1</tt>. Combined diff format
1176 was created for review of merge commit changes, and was not
1177 meant for apply. The change is similar to the change in the
1178 extended <em>index</em> header:
1179</p>
1180<div class="literalblock">
1181<div class="content">
1182<pre><tt>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</tt></pre>
1183</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311184<div class="para"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk
1185header for combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:291186</li>
Junio C Hamanoba4b9282008-07-06 05:20:311187</ol></div>
1188<div class="para"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamanofb56a962006-01-28 10:38:191189files A and B with a single column that has <tt>-</tt> (minus &#8212;
1190appears in A but removed in B), <tt>+</tt> (plus &#8212; missing in A but
Junio C Hamano29f14312006-10-26 08:47:291191added to B), or <tt>" "</tt> (space &#8212; unchanged) prefix, this format
Junio C Hamanofb56a962006-01-28 10:38:191192compares two or more files file1, file2,&#8230; with one file X, and
1193shows how X differs from each of fileN. One column for each of
1194fileN is prepended to the output line to note how X's line is
Junio C Hamanoba4b9282008-07-06 05:20:311195different from it.</p></div>
1196<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:291197fileN but it does not appear in the result. A <tt>+</tt> character
Junio C Hamanofb56a962006-01-28 10:38:191198in the column N means that the line appears in the last file,
Junio C Hamano29f14312006-10-26 08:47:291199and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:311200added, from the point of view of that parent).</p></div>
1201<div class="para"><p>In the above example output, the function signature was changed
Junio C Hamanofb56a962006-01-28 10:38:191202from both files (hence two <tt>-</tt> removals from both file1 and
Junio C Hamanoba4b9282008-07-06 05:20:311203file2, plus <tt><tt>+</tt> to mean one line that was added does not appear
Junio C Hamanofb56a962006-01-28 10:38:191204in either file1 nor file2). Also two other lines are the same
Junio C Hamanoba4b9282008-07-06 05:20:311205from file1 but do not appear in file2 (hence prefixed with <tt> </tt></tt>).</p></div>
1206<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:191207merge commit with the merge result (i.e. file1..fileN are the
1208parents). When shown by <tt>git diff-files -c</tt>, it compares the
1209two unresolved merge parents with the working tree file
1210(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:311211"their version").</p></div>
Junio C Hamanofb56a962006-01-28 10:38:191212</div>
Junio C Hamanoba4b9282008-07-06 05:20:311213<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:021214<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311215<div class="para"><p>The <tt>--summary</tt> option describes newly added, deleted, renamed and
Junio C Hamano3a702342007-12-12 21:34:021216copied files. The <tt>--stat</tt> option adds diffstat(1) graph to the
1217output. These options can be combined with other options, such as
Junio C Hamanoba4b9282008-07-06 05:20:311218<tt>-p</tt>, and are meant for human consumption.</p></div>
1219<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:021220formats the pathnames compactly by combining common prefix and suffix of
1221the pathnames. For example, a change that moves <tt>arch/i386/Makefile</tt> to
Junio C Hamanoba4b9282008-07-06 05:20:311222<tt>arch/x86/Makefile</tt> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:021223<div class="listingblock">
1224<div class="content">
1225<pre><tt>arch/{i386 =&gt; x86}/Makefile | 4 +--</tt></pre>
1226</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311227<div class="para"><p>The <tt>--numstat</tt> option gives the diffstat(1) information but is designed
Junio C Hamano3a702342007-12-12 21:34:021228for easier machine consumption. An entry in <tt>--numstat</tt> output looks
Junio C Hamanoba4b9282008-07-06 05:20:311229like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:021230<div class="listingblock">
1231<div class="content">
1232<pre><tt>1 2 README
12333 1 arch/{i386 =&gt; x86}/Makefile</tt></pre>
1234</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311235<div class="para"><p>That is, from left to right:</p></div>
1236<div class="olist"><ol>
Junio C Hamano3a702342007-12-12 21:34:021237<li>
1238<p>
1239the number of added lines;
1240</p>
1241</li>
1242<li>
1243<p>
1244a tab;
1245</p>
1246</li>
1247<li>
1248<p>
1249the number of deleted lines;
1250</p>
1251</li>
1252<li>
1253<p>
1254a tab;
1255</p>
1256</li>
1257<li>
1258<p>
1259pathname (possibly with rename/copy information);
1260</p>
1261</li>
1262<li>
1263<p>
1264a newline.
1265</p>
1266</li>
Junio C Hamanoba4b9282008-07-06 05:20:311267</ol></div>
1268<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:021269<div class="listingblock">
1270<div class="content">
1271<pre><tt>1 2 README NUL
12723 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</tt></pre>
1273</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311274<div class="para"><p>That is:</p></div>
1275<div class="olist"><ol>
Junio C Hamano3a702342007-12-12 21:34:021276<li>
1277<p>
1278the number of added lines;
1279</p>
1280</li>
1281<li>
1282<p>
1283a tab;
1284</p>
1285</li>
1286<li>
1287<p>
1288the number of deleted lines;
1289</p>
1290</li>
1291<li>
1292<p>
1293a tab;
1294</p>
1295</li>
1296<li>
1297<p>
1298a NUL (only exists if renamed/copied);
1299</p>
1300</li>
1301<li>
1302<p>
1303pathname in preimage;
1304</p>
1305</li>
1306<li>
1307<p>
1308a NUL (only exists if renamed/copied);
1309</p>
1310</li>
1311<li>
1312<p>
1313pathname in postimage (only exists if renamed/copied);
1314</p>
1315</li>
1316<li>
1317<p>
1318a NUL.
1319</p>
1320</li>
Junio C Hamanoba4b9282008-07-06 05:20:311321</ol></div>
1322<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:021323scripts that read the output to tell if the current record being read is
1324a single-path record or a rename/copy record without reading ahead.
1325After reading added and deleted lines, reading up to <tt>NUL</tt> would yield
Junio C Hamanoba4b9282008-07-06 05:20:311326the pathname, but if that is <tt>NUL</tt>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:021327</div>
Junio C Hamanoba4b9282008-07-06 05:20:311328<h2 id="_author">Author</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231329<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311330<div class="para"><p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231331</div>
Junio C Hamanoba4b9282008-07-06 05:20:311332<h2 id="_documentation">Documentation</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231333<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311334<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:231335</div>
Junio C Hamanoba4b9282008-07-06 05:20:311336<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231337<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311338<div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231339</div>
1340<div id="footer">
1341<div id="footer-text">
Junio C Hamanoba4b9282008-07-06 05:20:311342Last updated 2008-07-06 05:16:43 UTC
Junio C Hamano1a4e8412005-12-27 08:17:231343</div>
1344</div>
1345</body>
1346</html>