git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Sverre Rabbelier <srabbelier@gmail.com>,
	Jonathan Nieder <jrnieder@gmail.com>,
	Git List <git@vger.kernel.org>, Jakub Narebski <jnareb@gmail.com>
Subject: Re: non-empty index with git commit -a
Date: Wed, 16 Feb 2011 10:51:31 -0800	[thread overview]
Message-ID: <7vpqqrke30.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20110216100622.GA12971@sigill.intra.peff.net> (Jeff King's message of "Wed\, 16 Feb 2011 05\:06\:34 -0500")

Jeff King <peff@peff.net> writes:

> On Wed, Feb 16, 2011 at 09:58:52AM +0000, Sverre Rabbelier wrote:
>
>> On Wed, Feb 16, 2011 at 09:54, Jeff King <peff@peff.net> wrote:
>> > So? Your question was whether index state is precious. If it's precious,
>> > shouldn't we be keeping a history of it?
>> 
>> I don't think it's quite _that_ precious, but the only operation that
>> I regularly use that can blow away my carefully constructed index as
>> side effect of doing something else is `git commit -a`.
>
> OK, so how precious is it? :)

The world is not that black-and-white, but is full of different shades of
gray.

If you made mistakes with a second "git add", you can "reset --mixed"
everything away and restart from scratch.  The same thing can be said for
a mistaken "git commit -a" that can be "reset HEAD^" (or --amend).  So
there is not much difference at the technical level.

I don't think this is primarily about "protecting the index".  It is more
about making the user feel better.  Compared to a mistaken second "add", a
mistaken "commit -a" feels like a lot heavier point-of-no-return.

  parent reply	other threads:[~2011-02-16 18:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 22:43 non-empty index with git commit -a Sverre Rabbelier
2011-02-16  2:36 ` Jeff King
2011-02-16  3:20   ` Jonathan Nieder
2011-02-16  3:27     ` Jeff King
2011-02-16  8:18     ` Sverre Rabbelier
2011-02-16  8:29       ` Nguyen Thai Ngoc Duy
2011-02-16  8:44         ` Jonathan Nieder
2011-02-16  8:51       ` Jeff King
2011-02-16  9:52         ` Sverre Rabbelier
2011-02-16  9:54           ` Jeff King
2011-02-16  9:58             ` Sverre Rabbelier
2011-02-16 10:06               ` Jeff King
2011-02-16 14:41                 ` Michael J Gruber
2011-02-16 19:29                   ` Jeff King
2011-02-16 18:51                 ` Junio C Hamano [this message]
2011-02-16 19:36                   ` Jeff King
2011-02-16 19:55                     ` Junio C Hamano
2011-02-16 19:59                       ` Jeff King
2011-02-16 21:03                         ` Jakub Narebski
2011-02-16 21:46                           ` Junio C Hamano
2011-02-16 22:34                             ` Jeff King
2011-02-16 10:28             ` Matthieu Moy
2011-02-16 19:48               ` Jeff King
2011-02-16 18:47           ` Junio C Hamano
2011-02-16  9:05     ` Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vpqqrke30.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    --cc=srabbelier@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).