Re: [FAQ?] Rationale for git's way to manage the index
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- May 6, 2007, 16:51 UTC
- Message-ID
- <Pine.LNX.4.64.0705061851411.4015@racer.site>
- In-Reply-To
- <vpqwszm9bm9.fsf@bauges.imag.fr>
Hi,
On Sun, 6 May 2007, Matthieu Moy wrote:
Show 11 quoted lines
> [...] > > % git satus -a > % git commit -a -m "..." > > In the former case, I have more commands to type, and in the second > case, I loose part of the stat-cache benefit: If I run "git status -a" > twice, the second run will actually diff all the files touched since > the last run, since "git status -a" actually updated a temporary > index, and discarded it afterwards, so it doesn't update the stat > information in the index (while "git status" would have).
Have you tried "git status" _without "-a"?
> In both cases, I can't really see the benefit.
The benefit is a clear distinguishing between DWIM and low level. The index contains _exactly_ what you told it to contain. By forcing users to use "-a" with "git commit", you make it clear that a separate update steo is involved, and if you made an error (which you see from the file list), you can abort, and start over with the original index.
Hth, Dscho