git-diff.txt: add section "output format" describing the diff formats
git-diff.txt includes diff-options.txt which for the -p option refers to a section "generating patches.." which is missing from the git-diff documentation. This patch adapts diff-format.txt to additionally mention the git-diff program, and includes diff-format.txt into git-diff.txt. Tino Keitel noticed this problem. Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Gerrit Pape committed
Oct 31, 2007 at 13:59 UTC
9e6c723087def70d001740db48cf042b77a1d9cd
2 files changed
+13
-9
Documentation/diff-format.txt
+10
-9
@@ -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.
3
4
These commands all compare two sets of things; what is
5
compared differs:
@@ -62,7 +62,8 @@ respectively.
62
diff format for merges
63
----------------------
64
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
67
to generate diff output also for merge commits. The output differs
68
from the format described above in the following way:
69
@@ -86,10 +87,10 @@ Generating patches with -p
87
--------------------------
88
89
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.
94
95
What the -p option produces is slightly different from the traditional
96
diff format.
@@ -137,8 +138,8 @@ file made it into the new one.
138
combined diff format
139
--------------------
140
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:
143
144
------------
145
diff --combined describe.c
Documentation/git-diff.txt
+3
@@ -82,6 +82,9 @@ include::diff-options.txt[]
82
the diff to the named paths (you can give directory
83
names and get diff for all files under them).
84
85
+Output format
86
+-------------
87
+include::diff-format.txt[]
88
89
EXAMPLES
90
--------