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>
This commit is contained in:
Gerrit Pape 2007-10-31 13:59:16 +00:00 committed by Junio C Hamano
parent 136e631670
commit 9e6c723087
2 changed files with 13 additions and 9 deletions

View file

@ -1,5 +1,5 @@
The output format from "git-diff-index", "git-diff-tree" and The output format from "git-diff-index", "git-diff-tree",
"git-diff-files" are very similar. "git-diff-files" and "git diff --raw" are very similar.
These commands all compare two sets of things; what is These commands all compare two sets of things; what is
compared differs: compared differs:
@ -62,7 +62,8 @@ respectively.
diff format for merges diff format for merges
---------------------- ----------------------
"git-diff-tree" and "git-diff-files" can take '-c' or '--cc' option "git-diff-tree", "git-diff-files" and "git-diff --raw"
can take '-c' or '--cc' option
to generate diff output also for merge commits. The output differs to generate diff output also for merge commits. The output differs
from the format described above in the following way: from the format described above in the following way:
@ -86,10 +87,10 @@ Generating patches with -p
-------------------------- --------------------------
When "git-diff-index", "git-diff-tree", or "git-diff-files" are run When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
with a '-p' option, they do not produce the output described above; with a '-p' option, or "git diff" without the '--raw' option, they
instead they produce a patch file. You can customize the creation do not produce the output described above; instead they produce a
of such patches via the GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS patch file. You can customize the creation of such patches via the
environment variables. GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.
What the -p option produces is slightly different from the traditional What the -p option produces is slightly different from the traditional
diff format. diff format.
@ -137,8 +138,8 @@ file made it into the new one.
combined diff format combined diff format
-------------------- --------------------
git-diff-tree and git-diff-files can take '-c' or '--cc' option "git-diff-tree", "git-diff-files" and "git-diff" can take '-c' or
to produce 'combined diff', which looks like this: '--cc' option to produce 'combined diff', which looks like this:
------------ ------------
diff --combined describe.c diff --combined describe.c

View file

@ -82,6 +82,9 @@ include::diff-options.txt[]
the diff to the named paths (you can give directory the diff to the named paths (you can give directory
names and get diff for all files under them). names and get diff for all files under them).
Output format
-------------
include::diff-format.txt[]
EXAMPLES EXAMPLES
-------- --------