Skip to content

Commit 62c666a

Browse files
committed
Merge branch 'gp/maint-diffdoc' into maint
* gp/maint-diffdoc: git-diff.txt: add section "output format" describing the diff formats
2 parents c67359b + 9e6c723 commit 62c666a

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

Documentation/diff-format.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
The output format from "git-diff-index", "git-diff-tree" and
2-
"git-diff-files" are very similar.
1+
The output format from "git-diff-index", "git-diff-tree",
2+
"git-diff-files" and "git diff --raw" are very similar.
33

44
These commands all compare two sets of things; what is
55
compared differs:
@@ -62,7 +62,8 @@ respectively.
6262
diff format for merges
6363
----------------------
6464

65-
"git-diff-tree" and "git-diff-files" can take '-c' or '--cc' option
65+
"git-diff-tree", "git-diff-files" and "git-diff --raw"
66+
can take '-c' or '--cc' option
6667
to generate diff output also for merge commits. The output differs
6768
from the format described above in the following way:
6869

@@ -86,10 +87,10 @@ Generating patches with -p
8687
--------------------------
8788

8889
When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
89-
with a '-p' option, they do not produce the output described above;
90-
instead they produce a patch file. You can customize the creation
91-
of such patches via the GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS
92-
environment variables.
90+
with a '-p' option, or "git diff" without the '--raw' option, they
91+
do not produce the output described above; instead they produce a
92+
patch file. You can customize the creation of such patches via the
93+
GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.
9394

9495
What the -p option produces is slightly different from the traditional
9596
diff format.
@@ -137,8 +138,8 @@ file made it into the new one.
137138
combined diff format
138139
--------------------
139140

140-
git-diff-tree and git-diff-files can take '-c' or '--cc' option
141-
to produce 'combined diff', which looks like this:
141+
"git-diff-tree", "git-diff-files" and "git-diff" can take '-c' or
142+
'--cc' option to produce 'combined diff', which looks like this:
142143

143144
------------
144145
diff --combined describe.c

Documentation/git-diff.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ include::diff-options.txt[]
8282
the diff to the named paths (you can give directory
8383
names and get diff for all files under them).
8484

85+
Output format
86+
-------------
87+
include::diff-format.txt[]
8588

8689
EXAMPLES
8790
--------

0 commit comments

Comments
 (0)