Re: non-empty index with git commit -a
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 16, 2011, 18:47 UTC
- Message-ID
- <7vtyg3ke9m.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <AANLkTik_F=d1CjNVfj35wgv0pL1LefOMnttXjs=s2wCQ@mail.gmail.com>
Sverre Rabbelier <srabbelier@gmail.com> writes:
Show 6 quoted lines
> On Wed, Feb 16, 2011 at 08:51, Jeff King <peff@peff.net> 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.