Rollback ate my commit message! (issue 1635)

Martin Geisler mg at lazybytes.net
Wed Nov 18 12:48:06 CST 2009


Greg Ward <greg-hg at gerg.ca> writes:

> On Tue, Nov 17, 2009 at 9:38 PM, Matt Mackall <mpm at selenic.com> wrote:
>>> So Mercurial rolls back the transaction.  Your beautiful patch is
>>> still there in the working dir, of course.  But that carefully crafted
>>> commit message?  Gone.  Poof!
>>
>> Why not save off the message in either:
>>
>> a) your commit edit helper
>> b) a pretxncommit hook of your own
>
> Sure, there are lots of ways I could fix this that benefit only me and
> my colleagues.  But this annoyance can affect anyone using Mercurial.
> ("Oops! typo in that commit message! I'll just rollback and fix it ...
> oh. wait. rollback ate my commit message.  @^%!^@^@#")  And it's even
> more likely to bite anyone using a pretxncommit hook with teeth.

It seems to me that rollback is being used too much -- we should instead
have an extension that will let people edit the commit messages.

I've always seen rollback as a low-level command that just happens to be
useful for quickly redoing a commit. It's low-level since it's so
limited: there's no indication of what will happen and there's only one
rollback point. A proper command that is meant to be used regularly
should not have such a simple interface. I would almost say that
rollback should have been a debug command.

I'm not opposed to have rollback save the commit message somewhere, but
I think the real solution is to stop using rollback so much.

I'm imagining an extension which lets me specify set of changesets where
I want to edit the commit messages. It then open my editor with a file
containing all the commit messages for me to edit. When I save the file,
the extension should do what qimport and qrefresh does to update the
commit messages.

Sort of how histedit lets me move, drop, edit, and fold changesets by
selecting them from a buffer, but here I only want to edit the commit
messages.

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20091118/1a4e2c0f/attachment.pgp>


More information about the Mercurial-devel mailing list