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

Gilles Moris gilles.moris at free.fr
Wed Feb 22 07:30:55 UTC 2012


On Tuesday 21 February 2012 06:18:36 pm Pierre-Yves David wrote:
> On Tue, Feb 21, 2012 at 12:18:05PM +0200, Idan Kamara wrote:
> > On Mon, Feb 20, 2012 at 6:29 PM, Antoine Pitrou <solipsis at pitrou.net> 
wrote:
> > > On Mon, 20 Feb 2012 17:19:44 +0100
> > >
> > > Jason Harris <jason at jasonfharris.com> wrote:
> > > > To the user, the amend part is really associated with commit. It's
> > > > doing the
> > > > same thing.
>
> I still disagree on this point. From the user point of view:
>
>     "commit" *create* a new changeset.
>
>     "amend"  *update* the content of an existing changeset.
>
> This is not the same thing at all.
>
> qnew != qrefresh
> commit != amend
>
> > > Do you plan to introduce a short-hand for "--amend", at least?
> >
> > I don't think the use case of amend warrants a short flag, so I'd advise
> > against it.
>
> I expect amend to become a very common operation (at least as much as
> qrefresh is).
>
> > When someone wants to amend I'd want them to be sure that that's what
> > they want to do.  Having to type a few more letters will help make sure
> > of that and prevent unfortunate mistakes.
> >
> > (also, the straight forward letter for it would be 'a' which can be
> > easily mistyped when wanting -A)
>
> The same kind of reasoning are port of my advocacy for a dedicated command.
> To make sure people people really mean amend they just have to type the
> dedicated command. This will prevent unfortunate mistake and
> misunderstanding by new comers.
>
> A dedicated command allow simple and elegant short form.

After balancing between the two alternatives, I would agree with Pierre-Yves 
for a dedicated command. There is a different intent in amending than what 
the original help text describes:
"commit the specified files or all outstanding changes"

Having it as an option would make it more difficult to find from the help 
pages.
I like mercurial because the CLI is neatly organized and keeps away from 
obscure options. So having a different command is probably a better bet, even 
though this is adding yet another command.

Regards.
Gilles.



More information about the Mercurial-devel mailing list