Wishlist: the ability to correct wrong commit messages.

Tony Mechelynck antoine.mechelynck at gmail.com
Mon Jul 1 15:57:26 UTC 2019


On Mon, Jul 1, 2019 at 4:15 PM Alan Mackenzie <acm at muc.de> wrote:
>
> Hello, Arne.
>
> Thanks for the reply!
>
> On Sun, Jun 30, 2019 at 23:13:47 +0200, Arne Babenhauserheide wrote:
>
> > Richard Hipp <drh at sqlite.org> writes:
>
> > > On 6/30/19, Alan Mackenzie <acm at muc.de> wrote:
>
> > >> 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.
>
> > > Just FYI:  The way Fossil (https://fossil-scm.org/) implements this
> > > is to have a special tag which when applied to a check-in, changes
> > > the check-in comment to the "value" part of the tag.  In this way,
> > > the original check-in comment is preserved, but an alternative
> > > comment is available and is used for display in history listings and
> > > whatnot.
>
> > > I have no idea whether or not a similar trick could be used with
> > > Mercurial...
>
> > The evolve extension allows this, but only for commits you did not yet
> > push to a publishing repository:
> > https://www.mercurial-scm.org/doc/evolution/
>
> That looks fairly scary.  Also, SourceForge, which hosts my repository,
> is still using Mercurial 2.6.2.  :-(
>
> I also find it frustrating that I'm "editing the commit".  I don't want
> to edit the commit.  I merely wish to edit ancillary information which
> describes the commit, but isn't (needn't be) an integral part of that
> commit.

With Mercurial, a commit description (unlike e.g. a tag name) is
considered part of the commit; for instance, the 40-nybble commit ID
is computed based on, among others, the commit description. So any
change to the commit description requires "changing the commit":
actually it creates a new commit with a new commit ID and deletes the
old commit. If in the meantime someone pulled that old commit, there
is no way (other than convincing the owner of the clone pulled to to
do it manually by means of some extension) to remove the spurious
commit from that clone.
>
> > Changing comments via a tag should also be a possible approach: You
> > could write an extension which hooks into the history display to do
> > that.
>
> I don't have the time (i.e. sufficient desire) to get into the innards of
> Mercurial.  I have resigned myself to the dispiriting sinking feeling
> that is inevitable when using a tool such as Mercurial.  But if there
> were a simple method to amend commit messages (which surely must be a
> fairly frequent need) I would use it.  Maybe evolution is simple, and I
> just got scared by the bulk of the documentation.
>
> > Best wishes,
> > Arne
> > --
> > Unpolitisch sein
> > heißt politisch sein
> > ohne es zu merken

Best regards,
Tony.



More information about the Mercurial mailing list