Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit bd52900

Browse files
committed
Documentation: Describe "git diff <blob> <blob>" separately
As it was not a common operation, it was described as if it is a side note for the more common two-commit variant, but this mode behaves very differently, e.g. it does not make any sense to ask recursive behaviour, or give the command a pathspec. Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 7e20105 commit bd52900

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Documentation/git-diff.txt

+7-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ SYNOPSIS
1212
'git diff' [options] [<commit>] [--] [<path>...]
1313
'git diff' [options] --cached [<commit>] [--] [<path>...]
1414
'git diff' [options] <commit> <commit> [--] [<path>...]
15+
'git diff' [options] <blob> <blob>
1516
'git diff' [options] [--no-index] [--] <path> <path>
1617

1718
DESCRIPTION
@@ -55,6 +56,11 @@ directories. This behavior can be forced by --no-index.
5556
This is to view the changes between two arbitrary
5657
<commit>.
5758

59+
'git diff' [options] <blob> <blob>::
60+
61+
This form is to view the differences between the raw
62+
contents of two blob objects.
63+
5864
'git diff' [--options] <commit>..<commit> [--] [<path>...]::
5965

6066
This is synonymous to the previous form. If <commit> on
@@ -72,8 +78,7 @@ directories. This behavior can be forced by --no-index.
7278
Just in case if you are doing something exotic, it should be
7379
noted that all of the <commit> in the above description, except
7480
in the last two forms that use ".." notations, can be any
75-
<tree>. The third form ('git diff <commit> <commit>') can also
76-
be used to compare two <blob> objects.
81+
<tree>.
7782

7883
For a more complete list of ways to spell <commit>, see
7984
"SPECIFYING REVISIONS" section in linkgit:gitrevisions[7].

0 commit comments

Comments
 (0)