From: Nicolas Pitre Date: Wed, 01 Feb 2006 22:25:18 GMT Subject: Re: [Census] So who uses git? Message-ID: In-Reply-To: <7v8xsu91vf.fsf@assigned-by-dhcp.cox.net> On Wed, 1 Feb 2006, Junio C Hamano wrote: > 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. > - "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