Re: [PATCH] Use a temporary index for interactive git-commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 30 December 2010 04:33, Jeff King <peff@xxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]