From: Junio C Hamano Date: Tue, 18 Dec 2012 19:32:57 GMT Subject: Re: Incorrect man page for git-diff Message-ID: <7vehinf95i.fsf@alter.siamese.dyndns.org> In-Reply-To: <50D0BF8D.5050004@gmail.com> Manlio Perillo writes: > I'm not sure the man page is wrong and should be changed: > > -- usage: git diff [] [ []] [--] [...] > ++ usage: git diff [] [ []] Comparison of two blob objects works entirely in different way (it is not even recursively comparing two tree-shaped things). I do not think this mode is common enough to deserve to be in the short help text, but it should be in the documentation, perhaps like this patch, I think. Documentation/git-diff.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git c/Documentation/git-diff.txt w/Documentation/git-diff.txt index f8d0819..f8c0601 100644 --- c/Documentation/git-diff.txt +++ w/Documentation/git-diff.txt @@ -12,6 +12,7 @@ SYNOPSIS 'git diff' [options] [] [--] [...] 'git diff' [options] --cached [] [--] [...] 'git diff' [options] [--] [...] +'git diff' [options] 'git diff' [options] [--no-index] [--] DESCRIPTION @@ -55,6 +56,11 @@ directories. This behavior can be forced by --no-index. This is to view the changes between two arbitrary . +'git diff' [options] :: + + This form is to view the differences between the raw + contents of two blob objects. + 'git diff' [--options] .. [--] [...]:: This is synonymous to the previous form. If on @@ -72,8 +78,7 @@ directories. This behavior can be forced by --no-index. Just in case if you are doing something exotic, it should be noted that all of the in the above description, except in the last two forms that use ".." notations, can be any -. The third form ('git diff ') can also -be used to compare two objects. +. For a more complete list of ways to spell , see "SPECIFYING REVISIONS" section in linkgit:gitrevisions[7].