diff --git a/Documentation/diff-generate-patch.txt b/Documentation/diff-generate-patch.txt index 4b5aa5c2e045f5..0a4dc761e64e0d 100644 --- a/Documentation/diff-generate-patch.txt +++ b/Documentation/diff-generate-patch.txt @@ -14,7 +14,7 @@ You can customize the creation of patch text via the `GIT_EXTERNAL_DIFF` and the `GIT_DIFF_OPTS` environment variables (see linkgit:git[1]), and the `diff` attribute (see linkgit:gitattributes[5]). -What the -p option produces is slightly different from the traditional +What the `-p` option produces is slightly different from the traditional diff format: 1. It is preceded by a "git diff" header that looks like this: @@ -30,20 +30,21 @@ name of the source file of the rename/copy and the name of the file that the rename/copy produces, respectively. 2. It is followed by one or more extended header lines: - - old mode - new mode - deleted file mode - new file mode - copy from - copy to - rename from - rename to - similarity index - dissimilarity index - index .. + -File modes are printed as 6-digit octal numbers including the file type +[synopsis] +old mode +new mode +deleted file mode +new file mode +copy from +copy to +rename from +rename to +similarity index +dissimilarity index +index .. ++ +File modes __ are printed as 6-digit octal numbers including the file type and file permission bits. + Path names in extended headers do not include the `a/` and `b/` prefixes. @@ -56,7 +57,7 @@ files, while 100% dissimilarity means that no line from the old file made it into the new one. + The index line includes the blob object names before and after the change. -The is included if the file mode does not change; otherwise, +The __ is included if the file mode does not change; otherwise, separate lines indicate the old and the new mode. 3. Pathnames with "unusual" characters are quoted as explained for @@ -134,17 +135,18 @@ or like this (when the `--cc` option is used): 2. It is followed by one or more extended header lines (this example shows a merge with two parents): - - index ,.. - mode ,.. - new file mode - deleted file mode , + -The `mode ,..` line appears only if at least one of -the is different from the rest. Extended headers with +[synopsis] +index ,`..` +mode ,`..` +new file mode +deleted file mode , ++ +The `mode` ____++,++____++..++____ line appears only if at least one of +the __ is different from the rest. Extended headers with information about detected content movement (renames and copying detection) are designed to work with the diff of two - and are not used by combined diff format. +__ and are not used by combined diff format. 3. It is followed by a two-line from-file/to-file header: