Re: [PATCH] rebase -i: only automatically amend commit if HEAD did not change

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] rebase -i: only automatically amend commit if HEAD did not change

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:59

"Avery Pennarun" [off-list ref] writes:
On 7/22/08, Johannes Schindelin [off-list ref] wrote:
quoted
 If the user called "rebase -i", marked a commit as "edit", "rebase
 --continue" would automatically amend the commit when there were
 staged changes.

 However, this is actively wrong when the current commit is not the
 one marked with "edit".  So guard against this.
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).  The special case fixed by this patch would thus not be
needed.
That would actually be in-line with the way how "rebase --skip" does the
resetting without asking the user to do so, wouldn't it?

Re: [PATCH] rebase -i: only automatically amend commit if HEAD did not change

From: Avery Pennarun <hidden>
Date: 2016-06-15 22:45:00

On 7/22/08, Junio C Hamano [off-list ref] wrote:
"Avery Pennarun" [off-list ref] writes:
 > 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).  The special case fixed by this patch would thus not be
 > needed.

That would actually be in-line with the way how "rebase --skip" does the
 resetting without asking the user to do so, wouldn't it?
I'm not sure exactly what you mean, but I think with my proposed
change, "rebase --skip" would do "git reset --hard HEAD" while "rebase
--continue" would do "git commit -a", so it would be nice and
symmetrical, where currently it isn't exactly.

Have fun,

Avery
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help