From: Conrad Irwin <conrad.irwin@gmail.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Use a temporary index for interactive git-commit
Date: Thu, 30 Dec 2010 12:41:18 +0000 [thread overview]
Message-ID: <AANLkTina562i6KzYR4AQbTNExJbCBA3bKHwA_7W45qAG@mail.gmail.com> (raw)
In-Reply-To: <20101230043355.GA24555@sigill.intra.peff.net>
On 30 December 2010 04:33, Jeff King <peff@peff.net> wrote:
>
> this behavior will not apply to "git add -p". So doesn't that introduce
> a new confusing inconsistency, that ^C from "git commit -p" abandons
> changes entirely, but from "git add -p" will silently stage changes?
>
That is an interesting observation. The intention of the commit was
not to make the
interactive add atomic, just isolated from the real index (much like
git commit /path/to/file.c
or git commit -a). This means that if you leave the commit message
empty (even after a
successful git-add--interactive) you have not staged any new files.
I'd agree that it would also make sense for git-add--interactive to be
atomic, so that when you
abort it forgets everything you've told it to do (and that this patch
highlights that very nicely).
At the moment git-add--interactive is atomic at a file level, i.e. it
remembers each decision for
git add --interactive, and for git add --patch, it saves your
decisions only once you've got to
the end of a file (not that you'd notice).
While I could fix git add -p in the same manner as git commit -p, by
using a temporary isolated
index, it would be better to change git-add--interactive directly, and
thus git checkout -p and
git reset -p too.
Conrad
prev parent reply other threads:[~2010-12-30 12:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-30 0:47 [PATCH] Use a temporary index for interactive git-commit Conrad Irwin
2010-12-30 2:51 ` Jonathan Nieder
2010-12-30 4:33 ` Jeff King
2010-12-30 12:41 ` Conrad Irwin [this message]
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=AANLkTina562i6KzYR4AQbTNExJbCBA3bKHwA_7W45qAG@mail.gmail.com \
--to=conrad.irwin@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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).