Rollback ate my commit message! (issue 1635)

Steve Borho steve at borho.org
Tue Nov 17 21:06:23 CST 2009


On Tue, Nov 17, 2009 at 8:11 PM, Greg Ward <greg-hg at gerg.ca> wrote:
> Hi all --
>
> several months ago, I filed issue 1635 because the behaviour of "hg
> rollback" occasionally annoyed me a bit.  Now I have discovered a
> really killer use case for fixing issue 1635: pretxncommit hooks.
>
> Imagine this: you prepare a beautiful patch and run "hg commit".  Type
> in a carefully handcrafted commit message that describes exactly what
> you did in clear, concise language.  (You know how hard that can be!)
> Then some jerk's pretxncommit hook barges in and tells you that your
> commit message is malformatted, or your code doesn't meet the style
> guideline, or you created a filename with spaces in it ... whatever
> your local hook is designed to enforce.
>
> 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!

<cough> commit tool </cough>

--
Steve Borho

PS: Yes, I know not everyone uses a GUI, but this is among the reasons
why commit tools are really useful.  Beyond hooks, you may decide you
need to do a bit more work before commit, and a decent tool will keep
your message for you between invocations.


More information about the Mercurial-devel mailing list