@@ -9,16 +9,15 @@ patch file. You can customize the creation of such patches via the
99GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.
1010
1111What the -p option produces is slightly different from the traditional
12- diff format.
12+ diff format:
1313
14- 1. It is preceded with a "git diff" header, that looks like
15- this:
14+ 1. It is preceded with a "git diff" header that looks like this:
1615
1716 diff --git a/file1 b/file2
1817+
1918The `a/` and `b/` filenames are the same unless rename/copy is
2019involved. Especially, even for a creation or a deletion,
21- `/dev/null` is _not_ used in place of `a/` or `b/` filenames.
20+ `/dev/null` is _not_ used in place of the `a/` or `b/` filenames.
2221+
2322When rename/copy is involved, `file1` and `file2` show the
2423name of the source file of the rename/copy and the name of
@@ -37,18 +36,39 @@ the file that rename/copy produces, respectively.
3736 similarity index <number>
3837 dissimilarity index <number>
3938 index <hash>..<hash> <mode>
40-
41- 3. TAB, LF, double quote and backslash characters in pathnames
42- are represented as `\t`, `\n`, `\"` and `\\`, respectively .
43- If there is need for such substitution then the whole
44- pathname is put in double quotes .
45-
39+ +
40+ File modes are printed as 6-digit octal numbers including the file type
41+ and file permission bits .
42+ +
43+ Path names in extended headers do not include the `a/` and `b/` prefixes .
44+ +
4645The similarity index is the percentage of unchanged lines, and
4746the dissimilarity index is the percentage of changed lines. It
4847is a rounded down integer, followed by a percent sign. The
4948similarity index value of 100% is thus reserved for two equal
5049files, while 100% dissimilarity means that no line from the old
5150file made it into the new one.
51+ +
52+ The index line includes the SHA-1 checksum before and after the change.
53+ The <mode> is included if the file mode does not change; otherwise,
54+ separate lines indicate the old and the new mode.
55+
56+ 3. TAB, LF, double quote and backslash characters in pathnames
57+ are represented as `\t`, `\n`, `\"` and `\\`, respectively.
58+ If there is need for such substitution then the whole
59+ pathname is put in double quotes.
60+
61+ 4. All the `file1` files in the output refer to files before the
62+ commit, and all the `file2` files refer to files after the commit.
63+ It is incorrect to apply each change to each file sequentially. For
64+ example, this patch will swap a and b:
65+
66+ diff --git a/a b/b
67+ rename from a
68+ rename to b
69+ diff --git a/b b/a
70+ rename from b
71+ rename to a
5272
5373
5474combined diff format
0 commit comments