Re: [Census] So who uses git?
- From
Nicolas Pitre <nico@cam.org>
- Date
- Feb 1, 2006, 22:25 UTC
- Message-ID
- <Pine.LNX.4.64.0602011717010.5397@localhost.localdomain>
- In-Reply-To
- <7v8xsu91vf.fsf@assigned-by-dhcp.cox.net>
On Wed, 1 Feb 2006, Junio C Hamano wrote:
Show 6 quoted lines
> To recap: > > - "git commit fileA..." means: update index at listed paths > (add/remove if necessary) and then commit the tree described > in index (the same as the current behaviour with explicit > paths).
No.
> - "git commit -a" means: update index with all local changes and > then commit the tree described in index (the same as the > current behaviour).
Sensible.
> - "git commit" means: write out the current index and commit > (the same as the current behaviour).
Sensible.
Show 8 quoted lines
> - "git commit --only fileA..." means: create a temporary index > from the current HEAD commit (or empty index if there is > none), update it at listed paths (add/remove if necessary) > and commit the resulting tree. Also update the real index at > the listed paths (add/remove if necessary). In the original > index file, the paths listed must be either empty or match > exactly the HEAD commit -- otherwise we error out (Linus' > suggestion).
Actually, my opinion is that should be the behavior for your first item above (when only filenames are specified). If you want to _also_ include the index like you describe in your first item then an additional switch should be provided.
In other words, the --only should become --with-index with the behavior swapped.
The fact is that when you simply specify a filename, you really expect _only_ that filename will be affected and the rest be left alone. That's the most probable expectation for any tool. If you want _additional_ stuff to also be merged along with the files specified then it is logical to have an additional argument in that case, not the other way around.
Nicolas