Skip to content

Commit 0b080a7

Browse files
jnavilagitster
authored andcommitted
doc: git-diff: apply format changes to diff-generate-patch
Signed-off-by: Jean-Noël Avila <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6ace09b commit 0b080a7

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

Documentation/diff-generate-patch.txt

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ You can customize the creation of patch text via the
1414
`GIT_EXTERNAL_DIFF` and the `GIT_DIFF_OPTS` environment variables
1515
(see linkgit:git[1]), and the `diff` attribute (see linkgit:gitattributes[5]).
1616

17-
What the -p option produces is slightly different from the traditional
17+
What the `-p` option produces is slightly different from the traditional
1818
diff format:
1919

2020
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
3030
the file that the rename/copy produces, respectively.
3131

3232
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>
4533
+
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
4748
and file permission bits.
4849
+
4950
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
5657
file made it into the new one.
5758
+
5859
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,
6061
separate lines indicate the old and the new mode.
6162

6263
3. Pathnames with "unusual" characters are quoted as explained for
@@ -134,17 +135,18 @@ or like this (when the `--cc` option is used):
134135

135136
2. It is followed by one or more extended header lines
136137
(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>
142144
+
143145
The `mode <mode>,<mode>..<mode>` line appears only if at least one of
144146
the <mode> is different from the rest. Extended headers with
145147
information about detected content movement (renames and
146148
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.
148150

149151
3. It is followed by a two-line from-file/to-file header:
150152

0 commit comments

Comments
 (0)