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

Patrick Mézard patrick at mezard.eu
Fri Feb 17 11:44:30 CST 2012


Le 02/02/12 13:55, Idan Kamara a écrit :
> On Thu, Feb 2, 2012 at 2:45 PM, Angel Ezquerra <angel.ezquerra at gmail.com <mailto:angel.ezquerra at gmail.com>> wrote:
> 
>     On Thu, Feb 2, 2012 at 1:35 PM, Idan Kamara <idankk86 at gmail.com <mailto:idankk86 at gmail.com>> wrote:
>     > # HG changeset patch
>     > # User Idan Kamara <idankk86 at gmail.com <mailto:idankk86 at gmail.com>>
>     > # Date 1328185747 -7200
>     > # Branch stable
>     > # Node ID cc7dec00d5016f03acf789c35ce6ef50b204f0cb
>     > # Parent  0620421044a2bcaafd054a6ee454614888699de8
>     > commit: add --amend option to amend the parent changeset

[...]

> 
>     This is quite cool and a neat example of what can be done now that
>     mercurial tracks phases :-)
> 
>     One thing that would be nice is to be able to just "amend" the commit
>     message (without modifying the patch file contents). I think _that_ is
>     probably _the_ most commonly requested history editing operation (at
>     least in my experience).
> 
> 
> Right. I didn't take care of that yet and due to the current implementation
> it fails with a 'nothing changed' message. But it should be doable.

I think the UI for this should be addressed right away. What are the choices?

1- git commit --amend: open the editor with the current message all the time, even when the working directory is clean
2- Add qrefresh like --edit option

[1] looks tedious if you imagine having this behaviour by default with qrefresh. And [2] means adding another option to --commit, only meaningful in --amend context. In that case, "hg amend --edit" may sound cleaner.

Thoughts?
--
Patrick Mézard


More information about the Mercurial-devel mailing list