Skip to content

Commit

Permalink
Merge branch 'gp/maint-diffdoc' into maint
Browse files Browse the repository at this point in the history
* gp/maint-diffdoc:
  git-diff.txt: add section "output format" describing the diff formats
  • Loading branch information
Junio C Hamano committed Nov 6, 2007
2 parents c67359b + 9e6c723 commit 62c666a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
19 changes: 10 additions & 9 deletions Documentation/diff-format.txt
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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:

Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Documentation/git-diff.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------
Expand Down

0 comments on commit 62c666a

Please sign in to comment.