Skip to content

Commit 0c783f6

Browse files
committed
Documentation/git-diff: A..B and A...B cannot take tree-ishes
As pointed out by Linus, these notations require the endpoints given by the end user to be commits. Clarify. Also, three-dots in AsciiDoc are turned into ellipses unless quoted with bq. Be careful. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9d5fc59 commit 0c783f6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Documentation/git-diff.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,24 @@ forced by --no-index.
5353
one side is omitted, it will have the same effect as
5454
using HEAD instead.
5555

56-
'git-diff' [--options] <commit>...<commit> [--] [<path>...]::
56+
'git-diff' [--options] <commit>\...<commit> [--] [<path>...]::
5757

5858
This form is to view the changes on the branch containing
5959
and up to the second <commit>, starting at a common ancestor
60-
of both <commit>. "git-diff A...B" is equivalent to
60+
of both <commit>. "git-diff A\...B" is equivalent to
6161
"git-diff $(git-merge-base A B) B". You can omit any one
6262
of <commit>, which has the same effect as using HEAD instead.
6363

6464
Just in case if you are doing something exotic, it should be
65-
noted that all of the <commit> in the above description can be
66-
any <tree-ish>.
65+
noted that all of the <commit> in the above description, except
66+
for the last two forms that use ".." notations, can be any
67+
<tree-ish>.
6768

6869
For a more complete list of ways to spell <commit>, see
6970
"SPECIFYING REVISIONS" section in gitlink:git-rev-parse[1].
7071
However, "diff" is about comparing two _endpoints_, not ranges,
7172
and the range notations ("<commit>..<commit>" and
72-
"<commit>...<commit>") do not mean a range as defined in the
73+
"<commit>\...<commit>") do not mean a range as defined in the
7374
"SPECIFYING RANGES" section in gitlink:git-rev-parse[1].
7475

7576
OPTIONS

0 commit comments

Comments
 (0)