When should a user prefer one of `hg amend` or `hg commit --amend`?

Long Vu long.vu at intelerad.com
Fri Oct 23 21:01:36 UTC 2015


On Fri, Oct 23, 2015 at 4:35 PM, Pierre-Yves David
<pierre-yves.david at ens-lyon.org> wrote:
>
>
> On 10/23/2015 08:47 PM, Long Vu wrote:
>>
>> So both add the uncommitted changes in the workdir into the new commit
>> and obsolete the original one.
>>
>> `hg amend` create a "temporary amend commit" while `hg commit --amend` do
>> not.
>
>
> They both behave the same way in this regard, they actually use the very
> same code-path.

`hg commit --amend` just silently discard the temporary amend commit
while `hg amend` keeps it?

>
>> `hg amend` has -D which can replace `hg qrefresh -D` while `hg commit
>> --amend` do not.
>
>
> The current main difference is that `hg amend` does not pop the editor by
> default, this is open to debate.

If user do not need to edit the commit message, always popping up the
editor is annoying.  Like when I do `hg qrefresh` I do not
systematically want/need to edit my commit message every single time.

This is just a personal preference.  Maybe a preference in hgrc will
benefit everyone.

>
> `hg amend` also have special rewrite-related flag like -D or -U that `hg
> commit --amend` will not grow.
>

With a few usage today, I think will always use `hg amend -D` and not
`hg commit --amend`.

The -D is important for me to remember when I updated my commit.

Previously with versioned MQ, I can find out by looking at the commit
time in of the MQ patch so the date inside the patch does not matter
much.

If there is an hgrc preference for amend, personally, I would set -D always.

And like Bryan said, If the temporary amend commits bother me, I can
always strip them to clean up the clutter.


-- 
Long Vu | Build Controller | Intelerad | +1-514-931-6222 ext. 7743

-- 

This email or any attachments may contain confidential or legally 
privileged information intended for the sole use of the addressees. Any 
use, redistribution, disclosure, or reproduction of this information, 
except as intended, is prohibited. If you received this email in error, 
please notify the sender and remove all copies of the message, including 
any attachments.




More information about the Evolve-testers mailing list