git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* A few usability question about git diff --cached
@ 2007-10-04 12:27 Paolo Ciarrocchi
  2007-10-04 12:54 ` Wincent Colaiuta
  2007-10-04 12:56 ` Miklos Vajna
  0 siblings, 2 replies; 22+ messages in thread
From: Paolo Ciarrocchi @ 2007-10-04 12:27 UTC (permalink / raw)
  To: Git Mailing List

Hi all,
I'm having and interesting discussion with an happy mercurial users
which started reading the git documentation. He raised aquestion that
I'm not able to answer:

> $ git diff --cached
>
> (Without —cached, git-diff(1) will show you any changes that you've
> made but not yet added to the index.) You can also get a brief summary
> of the situation with git-status(1):

Why do we have the option "--cached" and not "--index"?

I believe that, just reading the documentation, is not very easy to
fully understand the role of the index and then we have an option
"--cached" that refers to the index.
Is it a good idea to add and document an option "--index" and remove
from the doc the option "--cached"?

Thanks.

Regards,
-- 
Paolo
http://paolo.ciarrocchi.googlepages.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-04 12:27 Paolo Ciarrocchi
@ 2007-10-04 12:54 ` Wincent Colaiuta
  2007-10-05  5:59   ` Miles Bader
  2007-10-04 12:56 ` Miklos Vajna
  1 sibling, 1 reply; 22+ messages in thread
From: Wincent Colaiuta @ 2007-10-04 12:54 UTC (permalink / raw)
  To: Paolo Ciarrocchi; +Cc: Git Mailing List

El 4/10/2007, a las 14:27, Paolo Ciarrocchi escribió:

> Hi all,
> I'm having and interesting discussion with an happy mercurial users
> which started reading the git documentation. He raised aquestion that
> I'm not able to answer:
>
>> $ git diff --cached
>>
>> (Without —cached, git-diff(1) will show you any changes that you've
>> made but not yet added to the index.) You can also get a brief  
>> summary
>> of the situation with git-status(1):
>
> Why do we have the option "--cached" and not "--index"?

I am not an "old timer", but I believe that it's because what we now  
know as "the index" was original called "the cache". See:

<http://git.or.cz/gitwiki/GitHistory>

You're probably right that the option name is confusing, I guess  
changing it to "--index" would be a good idea, continuing to support  
"--cached" but marking it as deprecated before finally removing it at  
some point in the future.

Cheers,
Wincent

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-04 12:27 Paolo Ciarrocchi
  2007-10-04 12:54 ` Wincent Colaiuta
@ 2007-10-04 12:56 ` Miklos Vajna
  2007-10-04 13:10   ` Paolo Ciarrocchi
  2007-10-04 13:14   ` Junio C Hamano
  1 sibling, 2 replies; 22+ messages in thread
From: Miklos Vajna @ 2007-10-04 12:56 UTC (permalink / raw)
  To: Paolo Ciarrocchi; +Cc: Git Mailing List

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

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

- VMiklos

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-04 12:56 ` Miklos Vajna
@ 2007-10-04 13:10   ` Paolo Ciarrocchi
  2007-10-04 13:14   ` Junio C Hamano
  1 sibling, 0 replies; 22+ messages in thread
From: Paolo Ciarrocchi @ 2007-10-04 13:10 UTC (permalink / raw)
  To: Miklos Vajna; +Cc: Git Mailing List

On 10/4/07, Miklos Vajna <vmiklos@frugalware.org> wrote:
> 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

Believe me, for a GIT newbie git --cached is confusing.

That user started reading "A tutorial introduction to git (for version
1.5.1 or newer)",
after a cuple of minutes of reading he reached "Making changes" saw:

" You are now ready to commit. You can see what is about to be
committed using git-diff(1) with the —cached option:

$ git diff --cached "

$ git diff --index sound a lof more consistent with the general documentation.

Regards,
-- 
Paolo
http://paolo.ciarrocchi.googlepages.com/
http://ubuntista.blogspot.com

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  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
                       ` (2 more replies)
  1 sibling, 3 replies; 22+ messages in thread
From: Junio C Hamano @ 2007-10-04 13:14 UTC (permalink / raw)
  To: Miklos Vajna; +Cc: Paolo Ciarrocchi, Git Mailing List

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.

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.

An example of a command that supports both is "git apply".
Actually it is an extreme case in that it allows "no index" form
of operation, so it has "git apply", "git apply --cached", and
"git apply --index".  The --cached would only apply to index
without touching work tree, the --index would apply to both
index and work tree.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-04 13:14   ` Junio C Hamano
@ 2007-10-04 13:39     ` Paolo Ciarrocchi
  2007-10-04 14:09     ` Wincent Colaiuta
  2007-10-04 14:34     ` Johannes Schindelin
  2 siblings, 0 replies; 22+ messages in thread
From: Paolo Ciarrocchi @ 2007-10-04 13:39 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Miklos Vajna, Git Mailing List

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-04 13:14   ` Junio C Hamano
  2007-10-04 13:39     ` Paolo Ciarrocchi
@ 2007-10-04 14:09     ` Wincent Colaiuta
  2007-10-04 14:34     ` Johannes Schindelin
  2 siblings, 0 replies; 22+ messages in thread
From: Wincent Colaiuta @ 2007-10-04 14:09 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Miklos Vajna, Paolo Ciarrocchi, Git Mailing List

El 4/10/2007, a las 15:14, Junio C Hamano escribió:

> 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.
>
> 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.

Look at that with fresh eyes and you can see how it makes very little  
sense.

The option named "--index" works on more than the index and the  
option named "--cached" works only on the index. This sounds back-to- 
front.

IMO, better names would be:

--index : means work only on the index (and ignore the work tree);  
ie. it means what it says

--index-and-worktree : it also means what it says

The latter is more keystrokes but it's clearer.

Having said all this, I recognize that the likelihood of these option  
names ever being changed is close to zero. Like Paolo says in his  
other email, the documentation could be made clearer to avoid  
possible confusion.

Cheers,
Wincent

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-04 13:14   ` Junio C Hamano
  2007-10-04 13:39     ` Paolo Ciarrocchi
  2007-10-04 14:09     ` Wincent Colaiuta
@ 2007-10-04 14:34     ` Johannes Schindelin
  2007-10-04 14:40       ` Junio C Hamano
                         ` (2 more replies)
  2 siblings, 3 replies; 22+ messages in thread
From: Johannes Schindelin @ 2007-10-04 14:34 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Miklos Vajna, Paolo Ciarrocchi, Git Mailing List

Hi,

On Thu, 4 Oct 2007, Junio C Hamano wrote:

>  * --cached means work only on index and ignore work tree.

I guess I could live with "--staged" as a synonym for "--cached" (and 
maybe deprecating "--cached").

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  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:49       ` Wincent Colaiuta
  2 siblings, 1 reply; 22+ messages in thread
From: Junio C Hamano @ 2007-10-04 14:40 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Miklos Vajna, Paolo Ciarrocchi, Git Mailing List

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> On Thu, 4 Oct 2007, Junio C Hamano wrote:
>
>>  * --cached means work only on index and ignore work tree.
>
> I guess I could live with "--staged" as a synonym for "--cached" (and 
> maybe deprecating "--cached").

A handy mnemonic might be:

 * --index means work work tree through the index.  Once you get
   git, this is natural as you would not interact with files in
   the work tree that is not known to the index.

 * --cached means work only on the cached information in index.

Any change like swapping them or renaming --cached to --index
and making something else to mean what --index always meant will
break existing setups and people's scripts.  Won't happen.

Giving them synonyms without deprecation is a viable option, if
necessary.  I do not however see the need yet.  A few people who
haven't learned the lingo of the land yet can worry about
possible confusion, but I do not think that "worry" itself does
not count as real need.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-04 14:34     ` Johannes Schindelin
  2007-10-04 14:40       ` Junio C Hamano
@ 2007-10-04 14:44       ` Matthieu Moy
  2007-10-04 15:51         ` J. Bruce Fields
  2007-10-05  5:22         ` David Tweed
  2007-10-04 15:49       ` Wincent Colaiuta
  2 siblings, 2 replies; 22+ messages in thread
From: Matthieu Moy @ 2007-10-04 14:44 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Junio C Hamano, Miklos Vajna, Paolo Ciarrocchi, Git Mailing List

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi,
>
> On Thu, 4 Oct 2007, Junio C Hamano wrote:
>
>>  * --cached means work only on index and ignore work tree.
>
> I guess I could live with "--staged" as a synonym for "--cached" (and 
> maybe deprecating "--cached").

It makes more sense to me.

For me, a "cache" is a fast-access copy of something, that I can
rebuild at any time. Cache should be only a matter of performance, if
the "cache" for an application changes its functionality, it means the
cache has been too optimistic. Git's index is not that, "git add"
means "add this to the index", which itself means "put that in the
list of things to commit", and not "get a copy of that to work faster
with it".

So, to me (non-native speaker), "index" doesn't mean much, "cache" is
worse, it means something which isn't correct, and "staging area"
means the right thing (but is longer to type). For example, I
understand immediately when git-gui talks me about staging/unstaging
changes ;-).

-- 
Matthieu

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-04 14:40       ` Junio C Hamano
@ 2007-10-04 14:47         ` David Kastrup
  0 siblings, 0 replies; 22+ messages in thread
From: David Kastrup @ 2007-10-04 14:47 UTC (permalink / raw)
  To: git

Junio C Hamano <gitster@pobox.com> writes:

>  * --index means work work tree through the index.  Once you get
>    git, this is natural as you would not interact with files in
>    the work tree that is not known to the index.
>
>  * --cached means work only on the cached information in index.

That is a rather shaky relation.

> Giving them synonyms without deprecation is a viable option, if
> necessary.  I do not however see the need yet.  A few people who
> haven't learned the lingo of the land yet can worry about possible
> confusion, but I do not think that "worry" itself does not count as
> real need.

The "lingo of the land" as documented in the manuals no longer uses
the term "cache" or "cached" as something with an official meaning.

So the current state of affairs does not really look overly convincing
with regard to consistency.

-- 
David Kastrup

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-04 14:34     ` Johannes Schindelin
  2007-10-04 14:40       ` Junio C Hamano
  2007-10-04 14:44       ` Matthieu Moy
@ 2007-10-04 15:49       ` Wincent Colaiuta
  2 siblings, 0 replies; 22+ messages in thread
From: Wincent Colaiuta @ 2007-10-04 15:49 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Junio C Hamano, Miklos Vajna, Paolo Ciarrocchi, Git Mailing List

El 4/10/2007, a las 16:34, Johannes Schindelin escribió:

> On Thu, 4 Oct 2007, Junio C Hamano wrote:
>
>>  * --cached means work only on index and ignore work tree.
>
> I guess I could live with "--staged" as a synonym for "--cached" (and
> maybe deprecating "--cached").

Good idea. I think that would partly address the consistency  
problems, be more accessible to new users, and easier to explain in  
the documentation.

Not that it makes much difference to me personally. One of the first  
things I did when I started using Git was set up two shell aliases  
(not Git aliases) seeing as looking at my staged and unstaged changes  
is for me such an extremely frequent operation:

   alias staged='git diff --cached'
   alias unstaged='git diff'

Cheers,
Wincent

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-04 14:44       ` Matthieu Moy
@ 2007-10-04 15:51         ` J. Bruce Fields
  2007-10-04 16:02           ` Matthieu Moy
  2007-10-05  5:22         ` David Tweed
  1 sibling, 1 reply; 22+ messages in thread
From: J. Bruce Fields @ 2007-10-04 15:51 UTC (permalink / raw)
  To: Matthieu Moy
  Cc: Johannes Schindelin, Junio C Hamano, Miklos Vajna,
	Paolo Ciarrocchi, Git Mailing List

On Thu, Oct 04, 2007 at 04:44:00PM +0200, Matthieu Moy wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > Hi,
> >
> > On Thu, 4 Oct 2007, Junio C Hamano wrote:
> >
> >>  * --cached means work only on index and ignore work tree.
> >
> > I guess I could live with "--staged" as a synonym for "--cached" (and 
> > maybe deprecating "--cached").
> 
> It makes more sense to me.
> 
> For me, a "cache" is a fast-access copy of something, that I can
> rebuild at any time. Cache should be only a matter of performance, if
> the "cache" for an application changes its functionality, it means the
> cache has been too optimistic. Git's index is not that, "git add"
> means "add this to the index", which itself means "put that in the
> list of things to commit", and not "get a copy of that to work faster
> with it".

Yes, the index differs from the work tree or HEAD temporarily, but most
of it's life it's just a fast-access copy of something that you can
rebuild at any time.

So it's partly a "cache", partly a "staging area", and "index" is as
good a term for it as any.

--b.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-04 15:51         ` J. Bruce Fields
@ 2007-10-04 16:02           ` Matthieu Moy
  2007-10-04 16:19             ` J. Bruce Fields
  0 siblings, 1 reply; 22+ messages in thread
From: Matthieu Moy @ 2007-10-04 16:02 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Johannes Schindelin, Junio C Hamano, Miklos Vajna,
	Paolo Ciarrocchi, Git Mailing List

"J. Bruce Fields" <bfields@fieldses.org> writes:

> Yes, the index differs from the work tree or HEAD temporarily, 

Temporarily, yes, but the _point_ of having it is to have it differ
from HEAD (otherwise, you can't create a new revision), and from the
tree (otherwise, index-related commands are useless).

The stat-information, and sha1sum are actually a cache, but they don't
have to be user-visible, except for speed. "diff --cached" has nothing
to do with the stat information for the user.

-- 
Matthieu

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-04 16:02           ` Matthieu Moy
@ 2007-10-04 16:19             ` J. Bruce Fields
  2007-10-05  6:40               ` Matthieu Moy
  0 siblings, 1 reply; 22+ messages in thread
From: J. Bruce Fields @ 2007-10-04 16:19 UTC (permalink / raw)
  To: Matthieu Moy
  Cc: Johannes Schindelin, Junio C Hamano, Miklos Vajna,
	Paolo Ciarrocchi, Git Mailing List

On Thu, Oct 04, 2007 at 06:02:21PM +0200, Matthieu Moy wrote:
> "J. Bruce Fields" <bfields@fieldses.org> writes:
> 
> > Yes, the index differs from the work tree or HEAD temporarily, 
> 
> Temporarily, yes, but the _point_ of having it is to have it differ
> from HEAD (otherwise, you can't create a new revision), and from the
> tree (otherwise, index-related commands are useless).

Getting a nearly-instantaneous "git diff" would be sufficiently
important to justify its existance on its own, so I think you're
overstating the case.

> The stat-information, and sha1sum are actually a cache, but they don't
> have to be user-visible, except for speed.

That's a big exception.--b.

> "diff --cached" has nothing to do with the stat information for the
> user.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-04 14:44       ` Matthieu Moy
  2007-10-04 15:51         ` J. Bruce Fields
@ 2007-10-05  5:22         ` David Tweed
  1 sibling, 0 replies; 22+ messages in thread
From: David Tweed @ 2007-10-05  5:22 UTC (permalink / raw)
  To: Matthieu Moy
  Cc: Johannes Schindelin, Junio C Hamano, Miklos Vajna,
	Paolo Ciarrocchi, Git Mailing List

On 10/4/07, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> It makes more sense to me.
>
> For me, a "cache" is a fast-access copy of something, that I can
> rebuild at any time. Cache should be only a matter of performance, if
> the "cache" for an application changes its functionality, it means the
> cache has been too optimistic. Git's index is not that, "git add"
> means "add this to the index", which itself means "put that in the
> list of things to commit", and not "get a copy of that to work faster
> with it".

Just to say this interpretation is also the natural interpretation I
have for the term "cached", and it confused me no end when I was first
learning about git that the index was referred to as a cache. To be
fair, git the documentation was in flux at that time and it's now
referred too as a cache in very few places now.

An example of the kind of thing I have to think carefully about even
now, Junio said in a different mail:

"--cached means work only on the "cached information in index."

If I understand correctly, the term "cached information in index" is
more correctly "stored information in index" (or perhaps more
technically "staged information in index") since there may be
information in there which isn't a cache because it's no longer
present anywhere else (ie, not in a commit yet but also changed in the
working tree).

It's not a big thing, but the usage of cached in git still quite confuses me.

-- 
cheers, dave tweed__________________________
david.tweed@gmail.com
Rm 124, School of Systems Engineering, University of Reading.
"we had no idea that when we added templates we were adding a Turing-
complete compile-time language." -- C++ standardisation committee

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-04 12:54 ` Wincent Colaiuta
@ 2007-10-05  5:59   ` Miles Bader
  2007-10-05 10:27     ` Wincent Colaiuta
  0 siblings, 1 reply; 22+ messages in thread
From: Miles Bader @ 2007-10-05  5:59 UTC (permalink / raw)
  To: Wincent Colaiuta; +Cc: Paolo Ciarrocchi, Git Mailing List

Wincent Colaiuta <win@wincent.com> writes:
> You're probably right that the option name is confusing, I guess  
> changing it to "--index" would be a good idea, continuing to support  
> "--cached" but marking it as deprecated before finally removing it at  
> some point in the future.

Personally all I want is a short-option alias for --cached!

Hopefully something easily type-able (not uppercase)...

-Miles

-- 
Americans are broad-minded people.  They'll accept the fact that a person can
be an alcoholic, a dope fiend, a wife beater, and even a newspaperman, but if a
man doesn't drive, there is something wrong with him.  -- Art Buchwald

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-04 16:19             ` J. Bruce Fields
@ 2007-10-05  6:40               ` Matthieu Moy
  0 siblings, 0 replies; 22+ messages in thread
From: Matthieu Moy @ 2007-10-05  6:40 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Johannes Schindelin, Junio C Hamano, Miklos Vajna,
	Paolo Ciarrocchi, Git Mailing List

"J. Bruce Fields" <bfields@fieldses.org> writes:

>> The stat-information, and sha1sum are actually a cache, but they don't
>> have to be user-visible, except for speed.
>
> That's a big exception.--b.

Speed _is_ important, of course. But the user only benefits from
speed, he doesn't have to manipulate it explicitely. I may be
repeating myself, but "diff --cached" doesn't mean "diff using the
stat-cache", it means "diff using the cached _content_", which is
really unrelated from the stat-cache.

Mercurial also has fast diff (perhaps a bit slower that git, but same
order of magnitude), and has no user-visible index.

-- 
Matthieu

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-05  5:59   ` Miles Bader
@ 2007-10-05 10:27     ` Wincent Colaiuta
  2007-10-05 10:41       ` Miles Bader
  0 siblings, 1 reply; 22+ messages in thread
From: Wincent Colaiuta @ 2007-10-05 10:27 UTC (permalink / raw)
  To: Miles Bader; +Cc: Paolo Ciarrocchi, Git Mailing List

El 5/10/2007, a las 7:59, Miles Bader escribió:

> Wincent Colaiuta <win@wincent.com> writes:
>> You're probably right that the option name is confusing, I guess
>> changing it to "--index" would be a good idea, continuing to support
>> "--cached" but marking it as deprecated before finally removing it at
>> some point in the future.
>
> Personally all I want is a short-option alias for --cached!
>
> Hopefully something easily type-able (not uppercase)...

Did you see the aliases I posted earlier in the thread? I can't think  
of anything shorter or semantically clearer than "staged" and  
"unstaged".

Cheers,
Wincent

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
  2007-10-05 10:27     ` Wincent Colaiuta
@ 2007-10-05 10:41       ` Miles Bader
  0 siblings, 0 replies; 22+ messages in thread
From: Miles Bader @ 2007-10-05 10:41 UTC (permalink / raw)
  To: Wincent Colaiuta; +Cc: Paolo Ciarrocchi, Git Mailing List

On 10/5/07, Wincent Colaiuta <win@wincent.com> wrote:
> > Personally all I want is a short-option alias for --cached!
> >
> > Hopefully something easily type-able (not uppercase)...
>
> Did you see the aliases I posted earlier in the thread? I can't think
> of anything shorter or semantically clearer than "staged" and
> "unstaged".

The words are ok, I guess, but aliases are not a replacement for short
options.... really all frequently used, non-dangerous, options should
have a short variant (and diff --cached meets both criteria handily)!

-Miles
-- 
Do not taunt Happy Fun Ball.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
@ 2021-08-14 19:31 Court Rankin
  0 siblings, 0 replies; 22+ messages in thread
From: Court Rankin @ 2021-08-14 19:31 UTC (permalink / raw)
  To: gitster; +Cc: git, paolo.ciarrocchi, vmiklos

Courtney 

Sent from my iPhone

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: A few usability question about git diff --cached
@ 2023-01-12 11:54 Mohammed Al-Mahmeed
  0 siblings, 0 replies; 22+ messages in thread
From: Mohammed Al-Mahmeed @ 2023-01-12 11:54 UTC (permalink / raw)
  To: gitster; +Cc: git, paolo.ciarrocchi, vmiklos



Sent from my iPhone

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2023-01-12 12:08 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-12 11:54 A few usability question about git diff --cached Mohammed Al-Mahmeed
  -- strict thread matches above, loose matches on Subject: below --
2021-08-14 19:31 Court Rankin
2007-10-04 12:27 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
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

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).