Re: [PATCH] rebase -i: only automatically amend commit if HEAD did not change
- From
Dmitry Potapov <dpotapov@gmail.com>
- Date
- Jul 23, 2008, 12:01 UTC
- Message-ID
- <20080723120104.GQ2925@dpotapov.dyndns.org>
- In-Reply-To
- <32541b130807221522r2a43c49cl6400f00dbe7451a0@mail.gmail.com>
On Tue, Jul 22, 2008 at 06:22:34PM -0400, Avery Pennarun wrote:
Show 8 quoted lines
> > This patch is perhaps a symptom of something I've been meaning to ask > about for a while. > > Why doesn't "edit" just stage the commit and not auto-commit it at > all? That way an amend would *never* be necessary, and rebase > --continue would always do a commit -a (if there was anything left to > commit).
Actually, it would be better to refuse to continue if there are unstaged changes in the work tree, and if all changes are staged then just do git commit.
Show 7 quoted lines
> The special case fixed by this patch would thus not be > needed. > > It would also make it more obvious how to remove files from a commit, > for example, without having to learn about "git reset". For that > matter, you wouldn't have to learn about "git commit --amend" either, > and it would save typing.
It would not only save typing, but also help to avoid costly mistakes where users, being taught to use "git commit --amend" after editing during git-rebase, fire this command automatically after a conflict resolution and get two commits accidently squashed.
So, I completely agree that the current auto-commit behavior is not very user friendly...
Dmitry