1
- Generating patches with -p
2
- --------------------------
3
-
4
- When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
5
- with a `-p` option, "git diff" without the `--raw` option, or
6
- "git log" with the "-p" option, they
7
- do not produce the output described above; instead they produce a
8
- patch file. You can customize the creation of such patches via the
1
+ Generating patch text with -p
2
+ -----------------------------
3
+
4
+ Running
5
+ linkgit:git-diff[1],
6
+ linkgit:git-log[1],
7
+ linkgit:git-show[1],
8
+ linkgit:git-diff-index[1],
9
+ linkgit:git-diff-tree[1], or
10
+ linkgit:git-diff-files[1]
11
+ with the `-p` option produces patch text.
12
+ You can customize the creation of patch text via the
9
13
`GIT_EXTERNAL_DIFF` and the `GIT_DIFF_OPTS` environment variables.
10
14
11
15
What the -p option produces is slightly different from the traditional
@@ -49,7 +53,7 @@ similarity index value of 100% is thus reserved for two equal
49
53
files, while 100% dissimilarity means that no line from the old
50
54
file made it into the new one.
51
55
+
52
- The index line includes the SHA-1 checksum before and after the change.
56
+ The index line includes the blob object names before and after the change.
53
57
The <mode> is included if the file mode does not change; otherwise,
54
58
separate lines indicate the old and the new mode.
55
59
@@ -70,7 +74,7 @@ separate lines indicate the old and the new mode.
70
74
rename to a
71
75
72
76
73
- combined diff format
77
+ Combined diff format
74
78
--------------------
75
79
76
80
Any diff-generating command can take the `-c` or `--cc` option to
@@ -80,7 +84,7 @@ linkgit:git-show[1]. Note also that you can give the `-m` option to any
80
84
of these commands to force generation of diffs with individual parents
81
85
of a merge.
82
86
83
- A ' combined diff' format looks like this:
87
+ A " combined diff" format looks like this:
84
88
85
89
------------
86
90
diff --combined describe.c
@@ -113,11 +117,11 @@ index fabadb8,cc95eb0..4866510
113
117
------------
114
118
115
119
1. It is preceded with a "git diff" header, that looks like
116
- this (when `-c` option is used):
120
+ this (when the `-c` option is used):
117
121
118
122
diff --combined file
119
123
+
120
- or like this (when `--cc` option is used):
124
+ or like this (when the `--cc` option is used):
121
125
122
126
diff --cc file
123
127
@@ -160,7 +164,7 @@ parents.
160
164
4. Chunk header format is modified to prevent people from
161
165
accidentally feeding it to `patch -p1`. Combined diff format
162
166
was created for review of merge commit changes, and was not
163
- meant for apply . The change is similar to the change in the
167
+ meant to be applied . The change is similar to the change in the
164
168
extended 'index' header:
165
169
166
170
@@@ <from-file-range> <from-file-range> <to-file-range> @@@
0 commit comments