summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-02 16:12:04 -0700
committerJunio C Hamano <gitster@pobox.com>2007-11-02 16:12:04 -0700
commit784c099a30368af4238e2713e6220688119239a1 (patch)
treea280047ee5d0a1ec02c57664e88ed05cdb9cffed /Documentation
parent3e4bb087a18435b12eb82116e93af2887578e816 (diff)
parent9e6c723087def70d001740db48cf042b77a1d9cd (diff)
downloadgit-784c099a30368af4238e2713e6220688119239a1.tar.gz
Merge branch 'gp/maint-diffdoc'
* gp/maint-diffdoc: git-diff.txt: add section "output format" describing the diff formats
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/diff-format.txt19
-rw-r--r--Documentation/git-diff.txt3
2 files changed, 13 insertions, 9 deletions
diff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt
index 001503205b..9709c35c98 100644
--- a/Documentation/diff-format.txt
+++ b/Documentation/diff-format.txt
@@ -1,5 +1,5 @@
-The output format from "git-diff-index", "git-diff-tree" and
-"git-diff-files" are very similar.
+The output format from "git-diff-index", "git-diff-tree",
+"git-diff-files" and "git diff --raw" are very similar.
These commands all compare two sets of things; what is
compared differs:
@@ -62,7 +62,8 @@ respectively.
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
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
-with a '-p' option, they do not produce the output described above;
-instead they produce a patch file. You can customize the creation
-of such patches via the GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS
-environment variables.
+with a '-p' option, or "git diff" without the '--raw' option, they
+do not produce the output described above; instead they produce a
+patch file. You can customize the creation of such patches via the
+GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.
What the -p option produces is slightly different from the traditional
diff format.
@@ -137,8 +138,8 @@ file made it into the new one.
combined diff format
--------------------
-git-diff-tree and git-diff-files can take '-c' or '--cc' option
-to produce 'combined diff', which looks like this:
+"git-diff-tree", "git-diff-files" and "git-diff" can take '-c' or
+'--cc' option to produce 'combined diff', which looks like this:
------------
diff --combined describe.c
diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt
index ce0f502468..11c4216c4a 100644
--- a/Documentation/git-diff.txt
+++ b/Documentation/git-diff.txt
@@ -82,6 +82,9 @@ include::diff-options.txt[]
the diff to the named paths (you can give directory
names and get diff for all files under them).
+Output format
+-------------
+include::diff-format.txt[]
EXAMPLES
--------