From: Junio C Hamano Date: Wed, 16 Feb 2011 18:47:33 GMT Subject: Re: non-empty index with git commit -a Message-ID: <7vtyg3ke9m.fsf@alter.siamese.dyndns.org> In-Reply-To: Sverre Rabbelier writes: > On Wed, Feb 16, 2011 at 08:51, Jeff King wrote: >> I can just as easily run "git add -u", or "git add -p" on top of some >> changes and then realize afterwards that I actually wanted the previous >> index state. > > I disagree, those are all index manipulation tools, `git commit -a` is not. "git commmit" is not an index-manipulation tool. Giving "-a" or pathspec to the command however is. Having said that, exactly because "commit" _feels_ more like a point-of-no-return than a mistaken second "add" to the end user (even though it is not technically different), I think it is Ok to add a configuration that makes the command bail out when "-a" is given and there are changes to the index. I don't think it is sane to trigger the same safety when a pathspec is given, though.