From: Junio C Hamano <gitster@pobox.com>
To: Manlio Perillo <manlio.perillo@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Incorrect man page for git-diff
Date: Tue, 18 Dec 2012 11:32:57 -0800 [thread overview]
Message-ID: <7vehinf95i.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <50D0BF8D.5050004@gmail.com> (Manlio Perillo's message of "Tue, 18 Dec 2012 20:10:05 +0100")
Manlio Perillo <manlio.perillo@gmail.com> writes:
> I'm not sure the man page is wrong and should be changed:
>
> -- usage: git diff [<options>] [<commit> [<commit>]] [--] [<path>...]
> ++ usage: git diff [<options>] [<commit> [<commit>]]
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] [<commit>] [--] [<path>...]
'git diff' [options] --cached [<commit>] [--] [<path>...]
'git diff' [options] <commit> <commit> [--] [<path>...]
+'git diff' [options] <blob> <blob>
'git diff' [options] [--no-index] [--] <path> <path>
DESCRIPTION
@@ -55,6 +56,11 @@ directories. This behavior can be forced by --no-index.
This is to view the changes between two arbitrary
<commit>.
+'git diff' [options] <blob> <blob>::
+
+ This form is to view the differences between the raw
+ contents of two blob objects.
+
'git diff' [--options] <commit>..<commit> [--] [<path>...]::
This is synonymous to the previous form. If <commit> 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 <commit> in the above description, except
in the last two forms that use ".." notations, can be any
-<tree>. The third form ('git diff <commit> <commit>') can also
-be used to compare two <blob> objects.
+<tree>.
For a more complete list of ways to spell <commit>, see
"SPECIFYING REVISIONS" section in linkgit:gitrevisions[7].
prev parent reply other threads:[~2012-12-18 19:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-18 17:40 Incorrect man page for git-diff Manlio Perillo
2012-12-18 18:11 ` Junio C Hamano
2012-12-18 19:10 ` Manlio Perillo
2012-12-18 19:32 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vehinf95i.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=manlio.perillo@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.