[PATCH RFC] commit: add --amend option to amend the parent changeset

Martin Geisler mg at aragost.com
Mon Feb 20 14:22:13 UTC 2012


Idan Kamara <idankk86 at gmail.com> writes:

> On Mon, Feb 20, 2012 at 8:47 AM, Martin Geisler <mg at lazybytes.net> wrote:
>>
>> In that way, 'hg commit --amend' becomes very much like
>>
>>  hg rollback; hg commit -l .hg/last-message.txt
>>
>> with the twist that the editor is started even though a commit
>> message is given on the command line.
>
> Sometimes you might be doing several commits and only when you're
> about to push you review them and realize you've made a mistake.

Yeah, that happens regularly for me too.

> So I think it's also useful to amend a changeset with children (and
> then manually rebasing those to the amended commit, which raises the
> question whether rebase preserves date/user, and it turns out it
> does).

I feel that this is outside the scope of 'hg commit --amend'. I see that
flag as a safe way to do 'hg rollback; hg commit'. It's true that this
is limited and wont fix all problems, but if we keep the flag simple,
then we can the first history editing command into core!

More advanced history or commit message editing could then be provided
by another command (such as histedit).

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://www.aragost.com/mercurial/customer-projects/



More information about the Mercurial-devel mailing list