doc: git-diff: apply format changes to diff-generate-patch
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jean-Noël Avila committed
Nov 18, 2024 at 22:05 UTC
0b080a70abb392f658903d7d8da8fe51572e6e81
1 file changed
+23
-21
Documentation/diff-generate-patch.txt
+23
-21
@@ -14,7 +14,7 @@ You can customize the creation of patch text via the
14
`GIT_EXTERNAL_DIFF` and the `GIT_DIFF_OPTS` environment variables
15
(see linkgit:git[1]), and the `diff` attribute (see linkgit:gitattributes[5]).
16
17
-What the -p option produces is slightly different from the traditional
17
+What the `-p` option produces is slightly different from the traditional
18
diff format:
19
20
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
30
the file that the rename/copy produces, respectively.
31
32
2. It is followed by one or more extended header lines:
33
-
34
- old mode <mode>
35
- new mode <mode>
36
- deleted file mode <mode>
37
- new file mode <mode>
38
- copy from <path>
39
- copy to <path>
40
- rename from <path>
41
- rename to <path>
42
- similarity index <number>
43
- dissimilarity index <number>
44
- index <hash>..<hash> <mode>
33
+
46
-File modes are printed as 6-digit octal numbers including the file type
34
+[synopsis]
35
+old mode <mode>
36
+new mode <mode>
37
+deleted file mode <mode>
38
+new file mode <mode>
39
+copy from <path>
40
+copy to <path>
41
+rename from <path>
42
+rename to <path>
43
+similarity index <number>
44
+dissimilarity index <number>
45
+index <hash>..<hash> <mode>
46
++
47
+File modes _<mode>_ are printed as 6-digit octal numbers including the file type
48
and file permission bits.
49
+
50
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
57
file made it into the new one.
58
+
59
The index line includes the blob object names before and after the change.
59
-The <mode> is included if the file mode does not change; otherwise,
60
+The _<mode>_ is included if the file mode does not change; otherwise,
61
separate lines indicate the old and the new mode.
62
63
3. Pathnames with "unusual" characters are quoted as explained for
@@ -134,17 +135,18 @@ or like this (when the `--cc` option is used):
135
136
2. It is followed by one or more extended header lines
137
(this example shows a merge with two parents):
137
-
138
- index <hash>,<hash>..<hash>
139
- mode <mode>,<mode>..<mode>
140
- new file mode <mode>
141
- deleted file mode <mode>,<mode>
138
++
139
+[synopsis]
140
+index <hash>,<hash>..<hash>
141
+mode <mode>,<mode>`..`<mode>
142
+new file mode <mode>
143
+deleted file mode <mode>,<mode>
144
+
145
The `mode <mode>,<mode>..<mode>` line appears only if at least one of
146
the <mode> is different from the rest. Extended headers with
147
information about detected content movement (renames and
148
copying detection) are designed to work with the diff of two
147
-<tree-ish> and are not used by combined diff format.
149
+_<tree-ish>_ and are not used by combined diff format.
150
151
3. It is followed by a two-line from-file/to-file header:
152