Re: A few usability question about git diff --cached
- From
- J. Bruce Fields <bfields@fieldses.org>
- Date
- Oct 4, 2007, 15:51 UTC
- Message-ID
- <20071004155147.GA17487@fieldses.org>
- In-Reply-To
- <vpqtzp7ndn3.fsf@bauges.imag.fr>
On Thu, Oct 04, 2007 at 04:44:00PM +0200, Matthieu Moy wrote:
Show 20 quoted lines
> 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.