Wishlist: the ability to correct wrong commit messages.

David Demelier markand at malikania.fr
Mon Jul 1 09:36:08 UTC 2019


Le 30/06/2019 à 18:36, Alan Mackenzie a écrit :
> Hello, Mercurial.
> 
> It would be nice if one could fix errors in commit messages.  And by
> this, I don't mean a millisecond after making the mistake.  I mean after
> having grafted the commit onto the release branch, applying a tag, and
> pushing to an upstream repository.
> 
> One can fix mistakes in source files with an SCM; indeed, this is an
> essential feature of one.  So why can one not also fix mistakes in
> commit messages?
> 

If those changesets are still draft or public but you're sure they are 
not used elsewhere you can still use histedit extension to edit commit 
messages.

> There seem to be no conceptual barriers to this desirable ability.  One
> can picture a sort of "branch" in Mercurial, where successive
> corrections of a commit message would be stored.  A crucial feature of
> this feature would be the normal output of hg log not being cluttered up
> by commits superseding these erroneous commit messages.
> 
> At the moment, mercurial seems suitable for developers who never make
> mistakes (except in their source code).  Unfortunately, that's not me.
> Just this afternoon, being a little tired, I committed a commit with
> path descriptions from a different project.  And, of course, this was
> grafted onto the release branch, had a tag applied, and was pushed to
> the upstream repo before I noticed.

Unfortunately that's also things that happen. It's like sending a mail 
into a public mailing list. Once you've sent you're out of luck editing it.

On the other hand, if you really want to edit those revisions pushed, 
you could still strip them from the server and editing them locally 
(using histedit) and repush them again. You'll need to tell your users 
to discard the old revisions if they have pulled them earlier.

Regards,

-- 
David



More information about the Mercurial mailing list