git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
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 14:48:55 -0500	[thread overview]
Message-ID: <20110216194855.GC22045@sigill.intra.peff.net> (raw)
In-Reply-To: <vpqbp2cmfy6.fsf@bauges.imag.fr>

On Wed, Feb 16, 2011 at 11:28:17AM +0100, Matthieu Moy wrote:

> Jeff King <peff@peff.net> writes:
> 
> > So? Your question was whether index state is precious. If it's precious,
> > shouldn't we be keeping a history of it?
> 
> If it's really precious, it probably means you should be commit
> --amend instead. You'd get the reflog, and essentially the same
> functionalities.

Yeah, that is good advice, and I do actually end up doing a lot of
intermediate commits and then either amending or sorting them out at the
end. And that helps with sorting out big changes.

But it does sort of feel like saying "we don't need a safety valve. You
just need to back up your work before doing anything dangerous". I have
to remember to do it. Which is fine if my workflow is
add-amend-add-amend. But maybe I have some half-saved index state and I
am about to try doing a merge checkout or stash apply.

Anyway, I'm not convinced it is all that precious (at least not enough
to merit working on the reflog). Yes, there have been times I've wished
I could go back to the index state of a minute ago, and had to re-sort
changes. But it usually doesn't take all that much time (thanks to "git
add -p"). My main objection is that I just don't see those cases as
different from "git commit -a". Either it is worth protecting, or it
isn't.

-Peff

  reply	other threads:[~2011-02-16 19:49 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
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 [this message]
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

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

  git send-email \
    --in-reply-to=20110216194855.GC22045@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=jrnieder@gmail.com \
    --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.
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 NNTP newsgroup(s).