From: "Paolo Ciarrocchi" <paolo.ciarrocchi@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: "Miklos Vajna" <vmiklos@frugalware.org>,
"Git Mailing List" <git@vger.kernel.org>
Subject: Re: A few usability question about git diff --cached
Date: Thu, 4 Oct 2007 15:39:01 +0200 [thread overview]
Message-ID: <4d8e3fd30710040639x62d7b9cbr688aca141849212c@mail.gmail.com> (raw)
In-Reply-To: <7vy7ej9g38.fsf@gitster.siamese.dyndns.org>
On 10/4/07, Junio C Hamano <gitster@pobox.com> wrote:
> Miklos Vajna <vmiklos@frugalware.org> writes:
>
> > On Thu, Oct 04, 2007 at 02:27:41PM +0200, Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:
> >> Why do we have the option "--cached" and not "--index"?
> >
> > according to glossary.txt, 'cache' is an obsolete for 'index'. probably
> > this is the reason
> >
> > probably cache.h will be never renamed to index.h, i don't know if diff
> > --cached will be ever renamed to diff --index
>
> Probably never.
Ouch!
> Some commands support both --index and --cached and have
> different meanings. For them,
>
> * --index means work on both index and work tree;
> * --cached means work only on index and ignore work tree.
>
> In the case of "diff --cached", the latter is exactly what's
> happening. We do not say "git diff-index --index $commit"
> because "git diff-index" (and by extension, when you give only
> one commit to "git diff" as parameter) is all about a commit vs
> your uncommitted changes, so having you say "--index" is just
> silly. "git diff --cached" is just a shorthand for "git diff
> --cached HEAD". Because --cached would make sense to no other
> form of diff, its presense by definition means you are talking
> about the one-tree form of diff i.e. compare a commit with your
> uncommitted changes.
I see. But the problem is real. If we cannot solve the problem
changing the code of git we'll need to avoid this kind of
misunderstanding having "better" documentation.
As soon as I'll find some spare time I'll propose a patch to "A
tutorial introduction to git (for version 1.5.1 or newer)".
Thanks!
Regards,
--
Paolo
http://paolo.ciarrocchi.googlepages.com/
http://ubuntista.blogspot.com
next prev parent reply other threads:[~2007-10-04 13:39 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-04 12:27 A few usability question about git diff --cached Paolo Ciarrocchi
2007-10-04 12:54 ` Wincent Colaiuta
2007-10-05 5:59 ` Miles Bader
2007-10-05 10:27 ` Wincent Colaiuta
2007-10-05 10:41 ` Miles Bader
2007-10-04 12:56 ` Miklos Vajna
2007-10-04 13:10 ` Paolo Ciarrocchi
2007-10-04 13:14 ` Junio C Hamano
2007-10-04 13:39 ` Paolo Ciarrocchi [this message]
2007-10-04 14:09 ` Wincent Colaiuta
2007-10-04 14:34 ` Johannes Schindelin
2007-10-04 14:40 ` Junio C Hamano
2007-10-04 14:47 ` David Kastrup
2007-10-04 14:44 ` Matthieu Moy
2007-10-04 15:51 ` J. Bruce Fields
2007-10-04 16:02 ` Matthieu Moy
2007-10-04 16:19 ` J. Bruce Fields
2007-10-05 6:40 ` Matthieu Moy
2007-10-05 5:22 ` David Tweed
2007-10-04 15:49 ` Wincent Colaiuta
-- strict thread matches above, loose matches on Subject: below --
2021-08-14 19:31 Court Rankin
2023-01-12 11:54 Mohammed Al-Mahmeed
2024-07-02 14:13 Kenneth Porter
2024-07-02 14:13 Kenneth Porter
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=4d8e3fd30710040639x62d7b9cbr688aca141849212c@mail.gmail.com \
--to=paolo.ciarrocchi@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=vmiklos@frugalware.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).